Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ tokenizer = BertTokenizer.from_pretrained("RuudVelo/dutch_news_clf_bert_finetune
|
|
33 |
# Title
|
34 |
st.title("Dutch news article classification")
|
35 |
|
36 |
-
|
37 |
|
38 |
#if text:
|
39 |
# encoding = tokenizer(text, return_tensors="pt")
|
@@ -51,11 +51,11 @@ st.title("Dutch news article classification")
|
|
51 |
# st.pyplot(fig)
|
52 |
|
53 |
|
54 |
-
input = st.text_input('Context')
|
55 |
|
56 |
if st.button('Submit'):
|
57 |
with st.spinner('Generating a response...'):
|
58 |
-
encoding = tokenizer(
|
59 |
outputs = model(**encoding)
|
60 |
predictions = outputs.logits.argmax(-1)
|
61 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
|
|
33 |
# Title
|
34 |
st.title("Dutch news article classification")
|
35 |
|
36 |
+
text = st.text_area('Please type/copy/paste text of the Dutch article')
|
37 |
|
38 |
#if text:
|
39 |
# encoding = tokenizer(text, return_tensors="pt")
|
|
|
51 |
# st.pyplot(fig)
|
52 |
|
53 |
|
54 |
+
#input = st.text_input('Context')
|
55 |
|
56 |
if st.button('Submit'):
|
57 |
with st.spinner('Generating a response...'):
|
58 |
+
encoding = tokenizer(text, return_tensors="pt")
|
59 |
outputs = model(**encoding)
|
60 |
predictions = outputs.logits.argmax(-1)
|
61 |
probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
|