SHIROI-07 commited on
Commit
58856ad
·
verified ·
1 Parent(s): dd70cec

Delete app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -16
app.py DELETED
@@ -1,16 +0,0 @@
1
- from fastapi import FastAPI
2
- from pydantic import BaseModel
3
- from transformers import pipeline
4
-
5
- # Load emotion model
6
- classifier = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions", top_k=None)
7
-
8
- app = FastAPI(title="Emotion Detection API")
9
-
10
- class TextInput(BaseModel):
11
- text: str
12
-
13
- @app.post("/analyze")
14
- def analyze_emotion(data: TextInput):
15
- result = classifier(data.text)
16
- return {"emotions": result}