imbajin commented on code in PR #164:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/164#discussion_r1962981652
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/app.py:
##########
@@ -184,13 +178,22 @@ def refresh_ui_config_prompt() -> tuple:
admin_http_api(api_auth, log_stream)
app.include_router(api_auth)
-
+ # Mount Gradio inside FastAPI
# TODO: support multi-user login when need
app = gr.mount_gradio_app(
app, hugegraph_llm, path="/", auth=("rag", admin_settings.user_token)
if auth_enabled else None
)
- # TODO: we can't use reload now due to the config 'app' of uvicorn.run
- # ❎:f'{__name__}:app' / rag_web_demo:app /
hugegraph_llm.demo.rag_web_demo:app
- # TODO: merge unicorn log to avoid duplicate log output (should be
unified/fixed later)
- uvicorn.run(app, host=args.host, port=args.port, reload=False)
+ return app
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--host", type=str, default="0.0.0.0", help="host")
+ parser.add_argument("--port", type=int, default=8001, help="port")
+ args = parser.parse_args()
+
+ import logging
+ logging.getLogger("uvicorn.access").propagate = False
Review Comment:
Thanks a lot, there is another problem, as shown in the figure, the current
gradio logs are not under our control, and a large number of influxes are
flooding in.
<img width="1453" alt="image"
src="https://github.com/user-attachments/assets/ed02a8c1-8bde-4176-ad07-f61b52eb8667"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]