Spaces:
Sleeping
Sleeping
..
Browse files- app.py +4 -0
- requirements.txt +2 -1
app.py
CHANGED
|
@@ -12,6 +12,10 @@ model.eval()
|
|
| 12 |
class TextRequest(BaseModel):
|
| 13 |
texts: list[str]
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
@app.post("/check")
|
| 16 |
def check_text(payload: TextRequest):
|
| 17 |
inputs = tokenizer(payload.texts, padding=True, truncation=True, return_tensors="pt")
|
|
|
|
| 12 |
class TextRequest(BaseModel):
|
| 13 |
texts: list[str]
|
| 14 |
|
| 15 |
+
@app.get("/")
|
| 16 |
+
def root():
|
| 17 |
+
return {"status": "🟢 Hate Speech API is running!"}
|
| 18 |
+
|
| 19 |
@app.post("/check")
|
| 20 |
def check_text(payload: TextRequest):
|
| 21 |
inputs = tokenizer(payload.texts, padding=True, truncation=True, return_tensors="pt")
|
requirements.txt
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
transformers
|
| 4 |
-
torch
|
|
|
|
|
|
| 1 |
fastapi
|
| 2 |
uvicorn
|
| 3 |
transformers
|
| 4 |
+
torch
|
| 5 |
+
emoji
|