You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "Aryankb (via GitHub)" <gi...@apache.org> on 2025/02/20 03:22:25 UTC
[PR] Fastapi auto reload [incubator-hugegraph-ai]
Aryankb opened a new pull request, #164:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/164
Fixes #123
Fix: Enable FastAPI auto-reload in development mode.
Modifications:-
Modified uvicorn command such that it calls the function crate_app which returns the gradio app.
disabled log propagation for Uvicorn's access logs (logs of HTTP requests).
How to Test:-
Run python3 -m hugegraph_llm.demo.rag_demo.app in CLI
Modify any .py file in the project.
The server should restart automatically.
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix(llm): enable fastapi auto reload function [incubator-hugegraph-ai]
Posted by "Aryankb (via GitHub)" <gi...@apache.org>.
Aryankb commented on PR #164:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/164#issuecomment-2672584879
> Thanks for your contribution~
>
> Another small question, do you prefer to use [uv](https://github.com/astral-sh/uv) or Poetry for package and dependency management? (We are currently in Poetry)
@imbajin i am more comfortable with poetry
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix(llm): enable fastapi auto reload function [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on PR #164:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/164#issuecomment-2670662432
Thanks for your contribution~
Another small question, do you prefer to use [uv](https://github.com/astral-sh/uv) or Poetry for package and dependency management? (We are currently in Poetry)
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] fix(llm): enable fastapi auto reload function [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin merged PR #164:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/164
--
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org
Re: [PR] Fastapi auto reload [incubator-hugegraph-ai]
Posted by "imbajin (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@hugegraph.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org