Update document-based-assistant/app.py
Browse files
document-based-assistant/app.py
CHANGED
|
@@ -47,16 +47,27 @@ agent = CodeAgent(
|
|
| 47 |
stream_outputs=True
|
| 48 |
)
|
| 49 |
|
| 50 |
-
def
|
|
|
|
| 51 |
return agent.run(query)
|
| 52 |
|
| 53 |
iface = gr.Interface(
|
| 54 |
-
fn=
|
| 55 |
inputs="text",
|
| 56 |
outputs="text",
|
| 57 |
title="Document QA Agent"
|
| 58 |
)
|
| 59 |
|
| 60 |
-
#
|
| 61 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
|
|
|
| 47 |
stream_outputs=True
|
| 48 |
)
|
| 49 |
|
| 50 |
+
def predict(query: str):
|
| 51 |
+
"""GAIA entrypoint"""
|
| 52 |
return agent.run(query)
|
| 53 |
|
| 54 |
iface = gr.Interface(
|
| 55 |
+
fn=predict,
|
| 56 |
inputs="text",
|
| 57 |
outputs="text",
|
| 58 |
title="Document QA Agent"
|
| 59 |
)
|
| 60 |
|
| 61 |
+
# def agent_interface(query):
|
| 62 |
+
# return agent.run(query)
|
| 63 |
+
|
| 64 |
+
# iface = gr.Interface(
|
| 65 |
+
# fn=agent_interface,
|
| 66 |
+
# inputs="text",
|
| 67 |
+
# outputs="text",
|
| 68 |
+
# title="Document QA Agent"
|
| 69 |
+
# )
|
| 70 |
+
|
| 71 |
+
if __name__ == "__main__":
|
| 72 |
+
iface.launch(server_name="0.0.0.0", server_port=7860)
|
| 73 |
|