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: org:
input-files: ["/home/saba/notes/notes.org", "/home/saba/notes/writing.org"] compressed_jsonl: .notes.json.gz
input-filter: null embeddings_file: .note_embeddings.pt
compressed-jsonl: ".notes.json.gz" input_files:
embeddings-file: ".note_embeddings.pt" - /home/saba/notes/notes.org
- /home/saba/notes/writing.org
# ledger: input_filter: null
# input-files: /home/projects/personal-finance/bon.beancount processor:
# input-filter: null conversation:
# compressed-jsonl: .transactions.jsonl.gz conversation_history: ''
# embeddings-file: .transaction_embeddings.pt conversation_logfile: .conversation_logs.json
open_api_key: null
# image: search_type:
# 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:
asymmetric: 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: image:
encoder: "clip-ViT-B-32" encoder: clip-ViT-B-32

View file

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