Update app.py
Browse files
app.py
CHANGED
@@ -45,12 +45,12 @@ def invoke(openai_api_key, prompt, rag_option):
|
|
45 |
start_time_ms = round(time.time() * 1000)
|
46 |
|
47 |
if (rag_option == RAG_OFF):
|
48 |
-
completion, chain, cb = llm_chain(config,
|
49 |
|
50 |
if (completion.generations[0] != None and completion.generations[0][0] != None):
|
51 |
result = completion.generations[0][0].text
|
52 |
else:
|
53 |
-
completion, chain, cb = rag_chain(config,
|
54 |
|
55 |
result = completion["result"]
|
56 |
except Exception as e:
|
|
|
45 |
start_time_ms = round(time.time() * 1000)
|
46 |
|
47 |
if (rag_option == RAG_OFF):
|
48 |
+
completion, chain, cb = llm_chain(config, prompt)
|
49 |
|
50 |
if (completion.generations[0] != None and completion.generations[0][0] != None):
|
51 |
result = completion.generations[0][0].text
|
52 |
else:
|
53 |
+
completion, chain, cb = rag_chain(config, rag_option, prompt)
|
54 |
|
55 |
result = completion["result"]
|
56 |
except Exception as e:
|