Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
import torch.nn.functional as F
|
4 |
-
from transformers
|
5 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
6 |
|
7 |
st.title('Can I Patent This?')
|
@@ -18,7 +18,6 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
18 |
test = [user_input]
|
19 |
|
20 |
if submit:
|
21 |
-
classifier = pipeline("sentiment-analysis", model = model_name) #using the pipeline() function
|
22 |
batch = tokenizer(test, padding = True, truncation = True, max_length = 512, return_tensors = "pt")
|
23 |
|
24 |
with torch.no_grad():
|
|
|
1 |
import streamlit as st
|
2 |
import torch
|
3 |
import torch.nn.functional as F
|
4 |
+
from transformers
|
5 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
6 |
|
7 |
st.title('Can I Patent This?')
|
|
|
18 |
test = [user_input]
|
19 |
|
20 |
if submit:
|
|
|
21 |
batch = tokenizer(test, padding = True, truncation = True, max_length = 512, return_tensors = "pt")
|
22 |
|
23 |
with torch.no_grad():
|