xset commited on
Commit
458c3f4
·
1 Parent(s): 2c6cccc

default / get

Browse files
Files changed (1) hide show
  1. main.py +5 -1
main.py CHANGED
@@ -8,7 +8,7 @@ import logging
8
  # Проверка версии NumPy
9
  assert np.__version__.startswith('1.'), f"Несовместимая версия NumPy: {np.__version__}"
10
 
11
- app = FastAPI(root_path="/")
12
 
13
  class RequestData(BaseModel):
14
  prompt: str
@@ -44,6 +44,10 @@ async def startup_event():
44
  routes = [route.path for route in app.routes]
45
  print(f"Registered routes: {routes}")
46
 
 
 
 
 
47
  @app.post("/")
48
  async def generate_text(request: RequestData):
49
  if not generator:
 
8
  # Проверка версии NumPy
9
  assert np.__version__.startswith('1.'), f"Несовместимая версия NumPy: {np.__version__}"
10
 
11
+ app = FastAPI()
12
 
13
  class RequestData(BaseModel):
14
  prompt: str
 
44
  routes = [route.path for route in app.routes]
45
  print(f"Registered routes: {routes}")
46
 
47
+ @app.get("/")
48
+ async def root_health_check():
49
+ return {"status": "ok"}
50
+
51
  @app.post("/")
52
  async def generate_text(request: RequestData):
53
  if not generator: