Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,12 +31,12 @@ user_friendly_name_list = list(user_friendly_name.values())
|
|
31 |
#demo = gr.Interface.from_pipeline(pipe)
|
32 |
#demo.launch()
|
33 |
|
34 |
-
def predict(text,
|
35 |
|
36 |
-
|
37 |
|
38 |
# Initialize the pipeline with the chosen model
|
39 |
-
model_pipeline = pipeline("text-classification", model=
|
40 |
result = model_pipeline(text)
|
41 |
label = result[0]['label']
|
42 |
|
|
|
31 |
#demo = gr.Interface.from_pipeline(pipe)
|
32 |
#demo.launch()
|
33 |
|
34 |
+
def predict(text, chosen_model):
|
35 |
|
36 |
+
chosen_model_name = reverse_user_friendly_name[chosen_model]
|
37 |
|
38 |
# Initialize the pipeline with the chosen model
|
39 |
+
model_pipeline = pipeline("text-classification", model=chosen_model_name)
|
40 |
result = model_pipeline(text)
|
41 |
label = result[0]['label']
|
42 |
|