xset commited on
Commit
77f5a26
·
1 Parent(s): 458c3f4

debug things

Browse files
Files changed (1) hide show
  1. main.py +9 -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()
12
 
13
  class RequestData(BaseModel):
14
  prompt: str
@@ -50,6 +50,14 @@ async def root_health_check():
50
 
51
  @app.post("/")
52
  async def generate_text(request: RequestData):
 
 
 
 
 
 
 
 
53
  if not generator:
54
  raise HTTPException(status_code=503, detail="Модель не загружена")
55
 
 
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
 
50
 
51
  @app.post("/")
52
  async def generate_text(request: RequestData):
53
+ print("Incoming path:", request.url.path)
54
+ print("Headers:", dict(request.headers))
55
+ body = await request.body()
56
+ print("Raw body:", body)
57
+
58
+ if not request.prompt:
59
+ return JSONResponse(content={"status": "ok"})
60
+
61
  if not generator:
62
  raise HTTPException(status_code=503, detail="Модель не загружена")
63