Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,10 @@ tokenizer=AutoTokenizer.from_pretrained(model_name)
|
|
7 |
model=AutoModelForSequenceClassification.from_pretrained(model_name)
|
8 |
|
9 |
#this where the model is active and we need to make the gradiends in active
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
13 |
if len(text)==0:
|
14 |
return f"the input text is {text}"
|
15 |
else:
|
|
|
7 |
model=AutoModelForSequenceClassification.from_pretrained(model_name)
|
8 |
|
9 |
#this where the model is active and we need to make the gradiends in active
|
10 |
+
|
11 |
+
def model_classifier(text):
|
12 |
+
model.eval()
|
13 |
+
with torch.no_grad():
|
14 |
if len(text)==0:
|
15 |
return f"the input text is {text}"
|
16 |
else:
|