Spaces:
Runtime error
Runtime error
new
Browse files
app.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
|
|
|
|
3 |
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification, TextClassificationPipeline
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("dipesh/Intent-Classification-Bert-Base-Cased")
|
@@ -15,7 +17,6 @@ def predict(input_text):
|
|
15 |
return ans[0]['label']
|
16 |
|
17 |
|
18 |
-
predict
|
19 |
-
|
20 |
-
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
21 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
|
4 |
+
os.environ["CUDA_VISIBLE_DEVICES"]="0"
|
5 |
from transformers import AutoTokenizer, TFAutoModelForSequenceClassification, TextClassificationPipeline
|
6 |
|
7 |
tokenizer = AutoTokenizer.from_pretrained("dipesh/Intent-Classification-Bert-Base-Cased")
|
|
|
17 |
return ans[0]['label']
|
18 |
|
19 |
|
20 |
+
iface = gr.Interface(fn=predict, inputs="text", outputs="text", title="Intent Classifier",
|
21 |
+
description="Classifier")
|
|
|
22 |
iface.launch()
|