Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,12 @@ from llama_index import SimpleDirectoryReader, GPTListIndex, readers, GPTSimpleV
|
|
| 5 |
#openai.api_key = "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"
|
| 6 |
os.environ["OPENAI_API_KEY"] = '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'
|
| 7 |
|
| 8 |
-
def gradio_ask_ai(
|
| 9 |
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
| 10 |
query = user_input
|
| 11 |
response = index.query(query)
|
| 12 |
return response.response
|
| 13 |
|
| 14 |
-
demo = gradio.Interface(fn=gradio_ask_ai, inputs = "text", outputs = "text", title = "
|
| 15 |
|
| 16 |
demo.launch(inline=False)
|
|
|
|
| 5 |
#openai.api_key = "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"
|
| 6 |
os.environ["OPENAI_API_KEY"] = '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'
|
| 7 |
|
| 8 |
+
def gradio_ask_ai(user input):
|
| 9 |
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
| 10 |
query = user_input
|
| 11 |
response = index.query(query)
|
| 12 |
return response.response
|
| 13 |
|
| 14 |
+
demo = gradio.Interface(fn=gradio_ask_ai, inputs = "text", outputs = "text", title = "Meshwork bot")
|
| 15 |
|
| 16 |
demo.launch(inline=False)
|