Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ text = st.text_input('Enter text')
|
|
11 |
|
12 |
# out = model()
|
13 |
|
14 |
-
model = AutoModelForSequenceClassification.from_pretrained("./
|
15 |
# model.to('cuda')
|
16 |
|
17 |
if st.button("Predict"):
|
@@ -23,10 +23,8 @@ if st.button("Predict"):
|
|
23 |
utility = Utility()
|
24 |
id2label, label2id, tokenizer, tokenized_plot = utility.tokenize(clean_plot, ["Action","Drama", "Romance", "Comedy", "Thriller"])
|
25 |
st.write(tokenized_plot)
|
26 |
-
|
27 |
-
|
28 |
-
# xval_input_ids = [np.asarray(xval[i]['input_ids']) for i in range(xval.shape[0])]
|
29 |
-
# xval_attention_mask = [np.asarray(xval[i]['attention_mask']) for i in range(xval.shape[0])]
|
30 |
st.write([np.asarray(tokenized_plot['input_ids'])])
|
31 |
st.write(clean_plot)
|
32 |
|
|
|
11 |
|
12 |
# out = model()
|
13 |
|
14 |
+
model = AutoModelForSequenceClassification.from_pretrained("./checkpoint-36819")
|
15 |
# model.to('cuda')
|
16 |
|
17 |
if st.button("Predict"):
|
|
|
23 |
utility = Utility()
|
24 |
id2label, label2id, tokenizer, tokenized_plot = utility.tokenize(clean_plot, ["Action","Drama", "Romance", "Comedy", "Thriller"])
|
25 |
st.write(tokenized_plot)
|
26 |
+
xtrain_input_ids = [np.asarray(tokenized_plot['input_ids'])]
|
27 |
+
xtrain_attention_mask = [np.asarray(tokenized_plot['attention_mask'])]
|
|
|
|
|
28 |
st.write([np.asarray(tokenized_plot['input_ids'])])
|
29 |
st.write(clean_plot)
|
30 |
|