Skip to content

Commit df5d3aa

Browse files
authored
Merge pull request #86 from camaze/issue_fastapi_reload
【CodeFuse】support fastapi hot reload
2 parents 2a61cc9 + 99534aa commit df5d3aa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

docker-compose.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ services:
170170
USER: root
171171
TZ: "${TZ}"
172172
OLLAMA_HOST: http://ollama:11434
173+
PYTHONPATH: /home/user/muagent/examples/ekg_examples
173174
ports:
174175
- 3737:3737
175176
volumes:
@@ -179,7 +180,7 @@ services:
179180
restart: on-failure
180181
networks:
181182
- ekg-net
182-
command: ["python", "/home/user/muagent/examples/ekg_examples/start.py"] # 指定要执行的脚本
183+
command: sh -c "uvicorn start:app --reload --reload-dir /home/user/muagent/examples --reload-dir /home/user/muagent/muagent --port=3737 --host=0.0.0.0"
183184

184185
ekgfrontend:
185186
build:

examples/ekg_examples/start.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def embed_query(self, text: str) -> List[float]:
320320

321321

322322
from muagent.httpapis.ekg_construct import create_api
323-
create_api(
323+
app = create_api(
324324
llm,
325325
llm_config,
326326
embeddings,

muagent/httpapis/ekg_construct/api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,5 +456,4 @@ def ekg_migration_reasoning(request: EKGFeaturesRequest):
456456

457457

458458
def create_api(llm, llm_config, embeddings,ekg_construct_service: EKGConstructService, memory_manager, geabase_handler, intention_router):
459-
app = init_app(llm, llm_config, embeddings,ekg_construct_service, memory_manager, geabase_handler, intention_router)
460-
uvicorn.run(app, host="0.0.0.0", port=3737)
459+
return init_app(llm, llm_config, embeddings,ekg_construct_service, memory_manager, geabase_handler, intention_router)

0 commit comments

Comments
 (0)