Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,11 +19,12 @@ model_list = [
|
|
19 |
#demo = gr.Interface.from_pipeline(pipe)
|
20 |
#demo.launch()
|
21 |
|
22 |
-
def predict(chosen_model):
|
23 |
|
24 |
# Initialize the pipeline with the chosen model
|
25 |
model_pipeline = pipeline("text-classification", model=chosen_model)
|
26 |
-
|
|
|
27 |
return label
|
28 |
|
29 |
inputs = [
|
|
|
19 |
#demo = gr.Interface.from_pipeline(pipe)
|
20 |
#demo.launch()
|
21 |
|
22 |
+
def predict(text, chosen_model):
|
23 |
|
24 |
# Initialize the pipeline with the chosen model
|
25 |
model_pipeline = pipeline("text-classification", model=chosen_model)
|
26 |
+
result = model_pipeline(text)
|
27 |
+
label = result[0]['label']
|
28 |
return label
|
29 |
|
30 |
inputs = [
|