Spaces:
Runtime error
Runtime error
Commit
·
4926683
1
Parent(s):
822c61d
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,12 @@ def chatbot(input_text):
|
|
21 |
response = index.query(input_text, response_mode="compact")
|
22 |
return response.response
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
iface = gr.Interface(fn=chatbot,
|
25 |
inputs=gr.components.Textbox(lines=7, label="Enter your text"),
|
26 |
outputs="text",
|
@@ -29,11 +35,7 @@ iface = gr.Interface(fn=chatbot,
|
|
29 |
index = construct_index("docs")
|
30 |
iface.launch(share=True)
|
31 |
|
32 |
-
|
33 |
-
from langchain.chat_models import ChatOpenAI
|
34 |
-
import gradio as gr
|
35 |
-
import sys
|
36 |
-
import os
|
37 |
|
38 |
os.environ["OPENAI_API_KEY"] = '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'
|
39 |
|
|
|
21 |
response = index.query(input_text, response_mode="compact")
|
22 |
return response.response
|
23 |
|
24 |
+
from gpt_index import SimpleDirectoryReader, GPTListIndex, GPTSimpleVectorIndex, LLMPredictor, PromptHelper
|
25 |
+
from langchain.chat_models import ChatOpenAI
|
26 |
+
import gradio as gr
|
27 |
+
import sys
|
28 |
+
import os
|
29 |
+
|
30 |
iface = gr.Interface(fn=chatbot,
|
31 |
inputs=gr.components.Textbox(lines=7, label="Enter your text"),
|
32 |
outputs="text",
|
|
|
35 |
index = construct_index("docs")
|
36 |
iface.launch(share=True)
|
37 |
|
38 |
+
|
|
|
|
|
|
|
|
|
39 |
|
40 |
os.environ["OPENAI_API_KEY"] = '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'
|
41 |
|