update tests

This commit is contained in:
hiyouga
2024-11-02 12:21:41 +08:00
parent 0a55e60693
commit 93d3b8f43f
23 changed files with 53 additions and 62 deletions

View File

@@ -23,8 +23,8 @@ from llamafactory.chat import ChatModel
def main():
chat_model = ChatModel()
app = create_app(chat_model)
api_host = os.environ.get("API_HOST", "0.0.0.0")
api_port = int(os.environ.get("API_PORT", "8000"))
api_host = os.getenv("API_HOST", "0.0.0.0")
api_port = int(os.getenv("API_PORT", "8000"))
print(f"Visit http://localhost:{api_port}/docs for API document.")
uvicorn.run(app, host=api_host, port=api_port)