Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,6 @@ st.markdown("### Please wait for the dataset and models to load (this can take s
|
|
54 |
@st.cache
|
55 |
def loaddset(d, d_split):
|
56 |
data = datasets.load_dataset(d, split=d_split)
|
57 |
-
st.text("Loaded the "+ str(d_split)+ " split of dataset "+ str(d))
|
58 |
return(data)
|
59 |
|
60 |
data = loaddset(dset,dset_split)
|
@@ -72,17 +71,18 @@ def load_models(mod_names):
|
|
72 |
globals()[f"model_{i}"] = AutoModelForSequenceClassification.from_pretrained(mod_names[i])
|
73 |
model_list.append(mod_names[i])
|
74 |
except:
|
75 |
-
|
76 |
-
return(
|
77 |
|
78 |
load_models(models)
|
79 |
|
80 |
@st.cache
|
81 |
def load_pipes(mod_list):
|
|
|
82 |
for i in range (len(mod_list)):
|
83 |
globals()[f"pipe_{i}"] = pipeline("text-classification", model = models[i], tokenizer = models[i], device=-1)
|
84 |
-
|
85 |
-
return(
|
86 |
|
87 |
load_pipes(model_list)
|
88 |
|
|
|
54 |
@st.cache
|
55 |
def loaddset(d, d_split):
|
56 |
data = datasets.load_dataset(d, split=d_split)
|
|
|
57 |
return(data)
|
58 |
|
59 |
data = loaddset(dset,dset_split)
|
|
|
71 |
globals()[f"model_{i}"] = AutoModelForSequenceClassification.from_pretrained(mod_names[i])
|
72 |
model_list.append(mod_names[i])
|
73 |
except:
|
74 |
+
continue
|
75 |
+
return(model_list)
|
76 |
|
77 |
load_models(models)
|
78 |
|
79 |
@st.cache
|
80 |
def load_pipes(mod_list):
|
81 |
+
pipe_list=[]
|
82 |
for i in range (len(mod_list)):
|
83 |
globals()[f"pipe_{i}"] = pipeline("text-classification", model = models[i], tokenizer = models[i], device=-1)
|
84 |
+
|
85 |
+
return(pipe_list)
|
86 |
|
87 |
load_pipes(model_list)
|
88 |
|