Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(llm): enable fastapi auto reload function #164

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

Aryankb
Copy link
Contributor

@Aryankb Aryankb commented Feb 20, 2025

Fixes #107
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.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 20, 2025
@github-actions github-actions bot added the llm label Feb 20, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 20, 2025
args = parser.parse_args()

import logging
logging.getLogger("uvicorn.access").propagate = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

image

@imbajin imbajin changed the title Fastapi auto reload fix(llm): enable fastapi auto reload function Feb 20, 2025
@imbajin
Copy link
Member

imbajin commented Feb 20, 2025

Thanks for your contribution~

Another small question, do you prefer to use uv or Poetry for package and dependency management? (We are currently in Poetry)

Copy link
Member

@imbajin imbajin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge this PR now, others issues could submit new PRs

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 20, 2025
@imbajin imbajin merged commit 9a9de77 into apache:main Feb 20, 2025
11 checks passed
@Aryankb
Copy link
Contributor Author

Aryankb commented Feb 20, 2025

Thanks for your contribution~

Another small question, do you prefer to use uv or Poetry for package and dependency management? (We are currently in Poetry)

@imbajin i am more comfortable with poetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer llm size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Summary] Good AI/LLM Tasks for Newcomers
2 participants