dump updated config to a yaml file

This commit is contained in:
Saba 2021-11-28 12:26:07 -05:00
parent 5b80b87379
commit 8837b02de6
2 changed files with 22 additions and 31 deletions

View file

@ -1,32 +1,22 @@
content-type:
content_type:
image: null
ledger: null
music: null
org:
input-files: ["/home/saba/notes/notes.org", "/home/saba/notes/writing.org"]
input-filter: null
compressed-jsonl: ".notes.json.gz"
embeddings-file: ".note_embeddings.pt"
# ledger:
# input-files: /home/projects/personal-finance/bon.beancount
# input-filter: null
# compressed-jsonl: .transactions.jsonl.gz
# embeddings-file: .transaction_embeddings.pt
# image:
# input-directory: "tests/data"
# embeddings-file: "tests/data/.image_embeddings.pt"
# batch-size: 50
# use-xmp-metadata: "no"
# music:
# input-files: ["tests/data/music.org"]
# input-filter: null
# compressed-jsonl: "tests/data/.songs.jsonl.gz"
# embeddings-file: "tests/data/.song_embeddings.pt"
search-type:
compressed_jsonl: .notes.json.gz
embeddings_file: .note_embeddings.pt
input_files:
- /home/saba/notes/notes.org
- /home/saba/notes/writing.org
input_filter: null
processor:
conversation:
conversation_history: ''
conversation_logfile: .conversation_logs.json
open_api_key: null
search_type:
asymmetric:
encoder: "sentence-transformers/msmarco-MiniLM-L-6-v3"
cross-encoder: "cross-encoder/ms-marco-MiniLM-L-6-v2"
cross_encoder: cross-encoder/ms-marco-MiniLM-L-6-v2
encoder: sentence-transformers/msmarco-MiniLM-L-6-v3
image:
encoder: "clip-ViT-B-32"
encoder: clip-ViT-B-32

View file

@ -37,8 +37,9 @@ def config():
@app.post('/config')
async def config(updated_config: FullConfig):
to_yaml = yaml.dump(updated_config.json())
print(to_yaml)
with open('config.yml', 'w') as outfile:
yaml.dump(yaml.safe_load(updated_config.json()), outfile)
outfile.close()
return updated_config
@app.get('/search')