Spaces:
Paused
Paused
Commit
·
92e1851
1
Parent(s):
98e3046
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,11 +27,10 @@ def construct_index(directory_path):
|
|
| 27 |
|
| 28 |
return index
|
| 29 |
|
| 30 |
-
index = construct_index("docs")
|
| 31 |
-
|
| 32 |
def chatbot(input_text):
|
| 33 |
-
query_engine = index.as_query_engine()
|
| 34 |
-
|
|
|
|
| 35 |
return response.response
|
| 36 |
|
| 37 |
iface = gr.Interface(fn=chatbot,
|
|
@@ -39,5 +38,5 @@ iface = gr.Interface(fn=chatbot,
|
|
| 39 |
outputs="text",
|
| 40 |
title="Demo Galicia")
|
| 41 |
|
| 42 |
-
|
| 43 |
iface.launch(share=True, debug=True)
|
|
|
|
| 27 |
|
| 28 |
return index
|
| 29 |
|
|
|
|
|
|
|
| 30 |
def chatbot(input_text):
|
| 31 |
+
#query_engine = index.as_query_engine()
|
| 32 |
+
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
| 33 |
+
response = index.query(input_text, response_mode="compact")
|
| 34 |
return response.response
|
| 35 |
|
| 36 |
iface = gr.Interface(fn=chatbot,
|
|
|
|
| 38 |
outputs="text",
|
| 39 |
title="Demo Galicia")
|
| 40 |
|
| 41 |
+
index = construct_index("docs")
|
| 42 |
iface.launch(share=True, debug=True)
|