Spaces:
Runtime error
Runtime error
abdulmatinomotoso
commited on
Commit
•
846bf7a
1
Parent(s):
cdd14f3
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ model_name = "valurank/distilroberta-spam-comments-detection"
|
|
11 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
|
14 |
-
|
15 |
|
16 |
def clean_text(raw_text):
|
17 |
text = raw_text.encode("ascii", errors="ignore").decode(
|
|
|
11 |
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
|
14 |
+
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
15 |
|
16 |
def clean_text(raw_text):
|
17 |
text = raw_text.encode("ascii", errors="ignore").decode(
|