Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,16 +7,21 @@ def install(package):
|
|
| 7 |
install("transformers")
|
| 8 |
install("torch")
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
from transformers import pipeline
|
| 13 |
|
| 14 |
-
app = FastAPI()
|
| 15 |
|
| 16 |
-
|
| 17 |
model = pipeline("text-classification", model="win2win/3-epochs-classifier-ver2")
|
| 18 |
|
| 19 |
-
|
| 20 |
-
@app.post("/predict")
|
| 21 |
-
async def predict(text: str):
|
| 22 |
-
return model(text)
|
|
|
|
| 7 |
install("transformers")
|
| 8 |
install("torch")
|
| 9 |
|
| 10 |
+
from transformers import pipeline
|
| 11 |
+
import gradio as gr
|
| 12 |
+
|
| 13 |
+
model = pipeline("text-classification", model="win2win/3-epochs-classifier-ver2")
|
| 14 |
|
| 15 |
+
def predict(text):
|
| 16 |
+
return model(text)
|
| 17 |
+
|
| 18 |
+
gr.Interface(fn=predict, inputs="text", outputs="json").launch()
|
| 19 |
+
|
| 20 |
+
import gradio as gr
|
| 21 |
from transformers import pipeline
|
| 22 |
|
|
|
|
| 23 |
|
| 24 |
+
|
| 25 |
model = pipeline("text-classification", model="win2win/3-epochs-classifier-ver2")
|
| 26 |
|
| 27 |
+
def predict(text):
|
|
|
|
|
|
|
|
|