bstraehle commited on
Commit
e497043
1 Parent(s): 9264481

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -55,7 +55,6 @@ def invoke(openai_api_key, prompt, rag_option):
55
  if (rag_option == RAG_LANGCHAIN):
56
  rag = LangChainRAG()
57
  completion, callback = rag.rag_chain(config, prompt)
58
-
59
  result = completion["result"]
60
  elif (rag_option == RAG_LLAMAINDEX):
61
  rag = LlamaIndexRAG()
@@ -63,10 +62,7 @@ def invoke(openai_api_key, prompt, rag_option):
63
  else:
64
  rag = LangChainRAG()
65
  completion, callback = rag.llm_chain(config, prompt)
66
-
67
- if (completion.generations[0] != None and
68
- completion.generations[0][0] != None):
69
- result = completion.generations[0][0].text
70
  except Exception as e:
71
  err_msg = e
72
 
 
55
  if (rag_option == RAG_LANGCHAIN):
56
  rag = LangChainRAG()
57
  completion, callback = rag.rag_chain(config, prompt)
 
58
  result = completion["result"]
59
  elif (rag_option == RAG_LLAMAINDEX):
60
  rag = LlamaIndexRAG()
 
62
  else:
63
  rag = LangChainRAG()
64
  completion, callback = rag.llm_chain(config, prompt)
65
+ result = completion.generations[0][0].text
 
 
 
66
  except Exception as e:
67
  err_msg = e
68