Skip to content

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

Merged
imbajin merged 3 commits intoapache:mainfrom
Aryankb:fastapi-auto-reload
Feb 20, 2025
Merged

fix(llm): enable fastapi auto reload function#164
imbajin merged 3 commits intoapache:mainfrom
Aryankb:fastapi-auto-reload

Conversation

@Aryankb
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@Aryankb
Copy link
Copy Markdown
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