Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def gradinterface(query, history):
|
| 4 |
+
# Assuming db and chain are already defined
|
| 5 |
+
docs = db.similarity_search(query)
|
| 6 |
+
response=chain.run(input_documents=docs, question=query)
|
| 7 |
+
return response
|
| 8 |
+
|
| 9 |
+
demo = gr.ChatInterface(fn=gradinterface, title='Fourseason Hotel')
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
if __name__ == "__main__":
|
| 14 |
+
demo.launch()
|