Spaces:
Runtime error
Runtime error
Commit
·
9e236a3
1
Parent(s):
c48a16b
Update app.py
Browse files
app.py
CHANGED
@@ -5,14 +5,13 @@ from transformers import BertForSequenceClassification
|
|
5 |
|
6 |
|
7 |
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
8 |
-
bert_classifier = BertForSequenceClassification.from_pretrained(
|
9 |
-
"./bert_classifier", return_dict=True).train(False)
|
10 |
|
11 |
st.markdown("Hello!")
|
12 |
sentence = st.text_input("Please, enter your sentence. I will try to make it more positive :)")
|
13 |
|
14 |
encodings = tokenizer(sentence, return_tensors='pt', padding=True)
|
15 |
-
with torch.no_grad():
|
16 |
-
|
17 |
|
18 |
-
st.markdown(
|
|
|
5 |
|
6 |
|
7 |
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
|
8 |
+
bert_classifier = BertForSequenceClassification.from_pretrained("bert_classifier", return_dict=True).train(False)
|
|
|
9 |
|
10 |
st.markdown("Hello!")
|
11 |
sentence = st.text_input("Please, enter your sentence. I will try to make it more positive :)")
|
12 |
|
13 |
encodings = tokenizer(sentence, return_tensors='pt', padding=True)
|
14 |
+
# with torch.no_grad():
|
15 |
+
# logits = bert_classifier(**encodings).logits
|
16 |
|
17 |
+
st.markdown(encodings)
|