Spaces:
Sleeping
Sleeping
add app
Browse files
app.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
"""
|
| 2 |
python interactive.py
|
| 3 |
"""
|
| 4 |
-
import
|
| 5 |
-
from transformers import AutoTokenizer, BertForSequenceClassification, AutoModelForSequenceClassification, AutoConfig
|
| 6 |
from transformers import TextClassificationPipeline
|
| 7 |
import gradio as gr
|
| 8 |
|
|
@@ -47,8 +46,9 @@ def predict(model_name, text):
|
|
| 47 |
)
|
| 48 |
print(pipe(text)[0])
|
| 49 |
|
|
|
|
| 50 |
for i in pipe(text)[0]:
|
| 51 |
-
output
|
| 52 |
|
| 53 |
return output
|
| 54 |
|
|
|
|
| 1 |
"""
|
| 2 |
python interactive.py
|
| 3 |
"""
|
| 4 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
|
|
| 5 |
from transformers import TextClassificationPipeline
|
| 6 |
import gradio as gr
|
| 7 |
|
|
|
|
| 46 |
)
|
| 47 |
print(pipe(text)[0])
|
| 48 |
|
| 49 |
+
output = []
|
| 50 |
for i in pipe(text)[0]:
|
| 51 |
+
output.append(i + '\t')
|
| 52 |
|
| 53 |
return output
|
| 54 |
|