add error handling for Keyerror
Browse files
app.py
CHANGED
|
@@ -87,8 +87,13 @@ with gr.Blocks() as demo:
|
|
| 87 |
ids = get_zotero_ids(zotero_api_key, zotero_library_id, zotero_tag)
|
| 88 |
|
| 89 |
df = get_arxiv_papers(ids)
|
| 90 |
-
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
feedback = upload_to_pinecone(pinecone_api_key, index_name, namespace_name, embeddings, dim, df)
|
| 94 |
|
|
|
|
| 87 |
ids = get_zotero_ids(zotero_api_key, zotero_library_id, zotero_tag)
|
| 88 |
|
| 89 |
df = get_arxiv_papers(ids)
|
| 90 |
+
try:
|
| 91 |
+
embeddings, dim = get_hf_embeddings(hf_api_key, df)
|
| 92 |
+
except KeyError as e:
|
| 93 |
+
print(e)
|
| 94 |
+
print('\n Resetting project...')
|
| 95 |
+
reset_project()
|
| 96 |
+
exit()
|
| 97 |
|
| 98 |
feedback = upload_to_pinecone(pinecone_api_key, index_name, namespace_name, embeddings, dim, df)
|
| 99 |
|