mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Use alias generator when deserializing the config file
This commit is contained in:
20
config.yml
20
config.yml
@@ -1,22 +1,22 @@
|
|||||||
content_type:
|
content-type:
|
||||||
image: null
|
image: null
|
||||||
ledger: null
|
ledger: null
|
||||||
music: null
|
music: null
|
||||||
org:
|
org:
|
||||||
compressed_jsonl: .notes.json.gz
|
compressed-jsonl: .notes.json.gz
|
||||||
embeddings_file: .note_embeddings.pt
|
embeddings-file: .note_embeddings.pt
|
||||||
input_files:
|
input-files:
|
||||||
- /home/saba/notes/notes.org
|
- /home/saba/notes/notes.org
|
||||||
- /home/saba/notes/writing.org
|
- /home/saba/notes/writing.org
|
||||||
input_filter: null
|
input-filter: null
|
||||||
processor:
|
processor:
|
||||||
conversation:
|
conversation:
|
||||||
conversation_history: ''
|
conversation-history: ''
|
||||||
conversation_logfile: .conversation_logs.json
|
conversation-logfile: .conversation_logs.json
|
||||||
open_api_key: null
|
open-api-key: null
|
||||||
search_type:
|
search-type:
|
||||||
asymmetric:
|
asymmetric:
|
||||||
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
|
encoder: sentence-transformers/msmarco-MiniLM-L-6-v3
|
||||||
image:
|
image:
|
||||||
encoder: clip-ViT-B-32
|
encoder: clip-ViT-B-32
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ def config():
|
|||||||
|
|
||||||
@app.post('/config')
|
@app.post('/config')
|
||||||
async def config(updated_config: FullConfig):
|
async def config(updated_config: FullConfig):
|
||||||
|
print(updated_config.dict())
|
||||||
with open(config_file, 'w') as outfile:
|
with open(config_file, 'w') as outfile:
|
||||||
yaml.dump(yaml.safe_load(updated_config.json()), outfile)
|
yaml.dump(yaml.safe_load(updated_config.json(by_alias=True)), outfile)
|
||||||
outfile.close()
|
outfile.close()
|
||||||
return updated_config
|
return updated_config
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user