Pash1986 commited on
Commit
02dae87
·
verified ·
1 Parent(s): 6aa004d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -49,8 +49,11 @@ def get_movies(message, history):
49
  for i in range(len(print_llm_text)):
50
  time.sleep(0.05)
51
  yield "Found: " + "\n\n" + print_llm_text[: i+1]
52
- except:
 
 
53
  yield "Please clone the repo and add your open ai key as well as your MongoDB Atlas UR in the Secret Section of you Space\n OPENAI_API_KEY (your Open AI key) and MONGODB_ATLAS_CLUSTER_URI (0.0.0.0/0 whitelisted instance with Vector index created) \n\n For more information : https://mongodb.com/products/platform/atlas-vector-search"
 
54
 
55
 
56
  demo = gr.ChatInterface(get_movies, examples=["What movies are scary?", "Find me a comedy", "Movies for kids"], title="Movies Atlas Vector Search",description="This small chat uses a similarity search to find relevant movies, it uses an MongoDB Atlase Vector Search read more here: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-tutorial",submit_btn="Search").queue()
 
49
  for i in range(len(print_llm_text)):
50
  time.sleep(0.05)
51
  yield "Found: " + "\n\n" + print_llm_text[: i+1]
52
+ except Exception as e:
53
+ error_message = traceback.format_exc()
54
+ yield "An error occurred: \n" + error_message
55
  yield "Please clone the repo and add your open ai key as well as your MongoDB Atlas UR in the Secret Section of you Space\n OPENAI_API_KEY (your Open AI key) and MONGODB_ATLAS_CLUSTER_URI (0.0.0.0/0 whitelisted instance with Vector index created) \n\n For more information : https://mongodb.com/products/platform/atlas-vector-search"
56
+
57
 
58
 
59
  demo = gr.ChatInterface(get_movies, examples=["What movies are scary?", "Find me a comedy", "Movies for kids"], title="Movies Atlas Vector Search",description="This small chat uses a similarity search to find relevant movies, it uses an MongoDB Atlase Vector Search read more here: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-tutorial",submit_btn="Search").queue()