Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ from fastapi.responses import HTMLResponse, PlainTextResponse
|
|
3 |
from fastapi.templating import Jinja2Templates
|
4 |
import uvicorn
|
5 |
import subprocess
|
6 |
-
PACKAGES = ["transformers", "accelerate", "torch"
|
7 |
for package in PACKAGES:
|
8 |
subprocess.run(["pip3", "install", package], check=True)
|
9 |
from transformers import pipeline
|
@@ -31,4 +31,4 @@ def analyze_output(input: str, pipe = pipeline("text-classification", model="Tit
|
|
31 |
return str({"type":"Spam", "probability":x["score"]})
|
32 |
|
33 |
if __name__ == "__main__":
|
34 |
-
uvicorn.run(app, host="0.0.0.0", port=
|
|
|
3 |
from fastapi.templating import Jinja2Templates
|
4 |
import uvicorn
|
5 |
import subprocess
|
6 |
+
PACKAGES = ["transformers", "accelerate", "torch"]
|
7 |
for package in PACKAGES:
|
8 |
subprocess.run(["pip3", "install", package], check=True)
|
9 |
from transformers import pipeline
|
|
|
31 |
return str({"type":"Spam", "probability":x["score"]})
|
32 |
|
33 |
if __name__ == "__main__":
|
34 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|