SAM_MedTesting / app.py
Axzyl's picture
Upload app.py
6de89fc verified
raw
history blame
469 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI(title="SAM_MedTesting")
class GenerationRequest(BaseModel):
prompt: str
max_new_tokens: int = 50
class GenerationResponse(BaseModel):
generated_text: str
@app.post("/generate", response_model=GenerationResponse)
def generate(req: GenerationRequest):
out = f"hello world: {req}"
return out
@app.get("/health")
def health():
return {"status": "ok"}