default / get
Browse files
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
|
|
@@ -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:
|