Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from transformers import TextClassificationPipeline, AutoTokenizer, AutoModelForSequenceClassification
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
# def get_model(model_name='Overfit-GM/temp_dist'):
|
5 |
# id2label = {0: 'INSULT', 1: 'OTHER',
|
@@ -22,8 +23,8 @@ models = [
|
|
22 |
]
|
23 |
|
24 |
model_box=[
|
25 |
-
gr.load(models[0], src='models'),
|
26 |
-
gr.load(models[1], src='models'),
|
27 |
]
|
28 |
|
29 |
def sentiment_analysis(text, model_choice):
|
|
|
1 |
from transformers import TextClassificationPipeline, AutoTokenizer, AutoModelForSequenceClassification
|
2 |
import gradio as gr
|
3 |
+
import os
|
4 |
|
5 |
# def get_model(model_name='Overfit-GM/temp_dist'):
|
6 |
# id2label = {0: 'INSULT', 1: 'OTHER',
|
|
|
23 |
]
|
24 |
|
25 |
model_box=[
|
26 |
+
gr.load(models[0], src='models', hf_token=os.environ['API_KEY']),
|
27 |
+
gr.load(models[1], src='models', hf_token=os.environ['API_KEY']),
|
28 |
]
|
29 |
|
30 |
def sentiment_analysis(text, model_choice):
|