Max005/DeepfakeDetection
0
1from transformers import pipeline2from fastapi import FastAPI3from pydantic import BaseModel4import uvicorn5 6# Define the input schema7class InputData(BaseModel):8 input: str9 10# Initialize the pipeline11pipe = pipeline("text-classification", model="phishbot/ScamLLM")12 13app = FastAPI()14 15# Define API endpoints16@app.post("/infer")17async def infer(data: InputData):18 predictions = pipe(data.input)19 return predictions20 21@app.get("/health")22async def health():23 return {"message": "ok"}24 25if __name__ == "__main__":26 uvicorn.run(app, host="0.0.0.0", port=8000)27 