Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,16 +32,10 @@ model_list = [
|
|
32 |
#demo = gr.Interface.from_pipeline(pipe)
|
33 |
#demo.launch()
|
34 |
|
35 |
-
def predict(
|
36 |
-
# Get model name from user-friendly name
|
37 |
-
full_chosen_model_name = chosen_model
|
38 |
|
39 |
# Initialize the pipeline with the chosen model
|
40 |
-
|
41 |
-
|
42 |
-
# Perform inference on the input text
|
43 |
-
predicted_label = model_pipeline(s1)[0] # Assuming your model returns a single prediction
|
44 |
-
|
45 |
return predicted_label
|
46 |
|
47 |
inputs = [
|
|
|
32 |
#demo = gr.Interface.from_pipeline(pipe)
|
33 |
#demo.launch()
|
34 |
|
35 |
+
def predict(chosen_model):
|
|
|
|
|
36 |
|
37 |
# Initialize the pipeline with the chosen model
|
38 |
+
predicted_label = pipeline("text-classification", model=chosen_model)
|
|
|
|
|
|
|
|
|
39 |
return predicted_label
|
40 |
|
41 |
inputs = [
|