JLW commited on
Commit
bf21e84
·
1 Parent(s): dba03dc

Implement embeddings

Browse files
Files changed (2) hide show
  1. app.py +7 -5
  2. requirements.txt +3 -3
app.py CHANGED
@@ -367,12 +367,14 @@ class ChatWrapper:
367
  openai.api_key = api_key
368
  if not monologue:
369
  if use_embeddings:
370
- output, hidden_text = "What's on your mind?", None
371
- if inp and inp.strip() != "" and docsearch:
372
- docs = docsearch.similarity_search(inp)
373
- output = qa_chain.run(input_documents=docs, question=inp)
 
 
374
  else:
375
- output = "Please supply some text in the the Embeddings tab."
376
  else:
377
  output, hidden_text = run_chain(chain, inp, capture_hidden_text=trace_chain)
378
  else:
 
367
  openai.api_key = api_key
368
  if not monologue:
369
  if use_embeddings:
370
+ if inp and inp.strip() != "":
371
+ if docsearch:
372
+ docs = docsearch.similarity_search(inp)
373
+ output = str(qa_chain.run(input_documents=docs, question=inp))
374
+ else:
375
+ output, hidden_text = "Please supply some text in the the Embeddings tab.", None
376
  else:
377
+ output, hidden_text = "What's on your mind?", None
378
  else:
379
  output, hidden_text = run_chain(chain, inp, capture_hidden_text=trace_chain)
380
  else:
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
- openai==0.26.1
2
- gradio==3.16.2
3
  google-search-results
4
- google-api-python-client==2.73.0
5
  wolframalpha
6
  langchain==0.0.64
7
  requests==2.28.2
 
1
+ openai==0.26.4
2
+ gradio==3.17.0
3
  google-search-results
4
+ google-api-python-client==2.75.0
5
  wolframalpha
6
  langchain==0.0.64
7
  requests==2.28.2