Spaces:
Runtime error
Runtime error
aliasgerovs
commited on
Commit
·
a32fa53
1
Parent(s):
5c0617b
Updated
Browse files
app.py
CHANGED
@@ -22,16 +22,16 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
22 |
print(f"Using device: {device}")
|
23 |
|
24 |
models = {
|
25 |
-
"Polygraf AI
|
26 |
"polygraf-ai/bc-roberta-openai-2sent"
|
27 |
).to(device),
|
28 |
-
"Polygraf AI
|
29 |
"polygraf-ai/bc_combined_3sent"
|
30 |
).to(device),
|
31 |
}
|
32 |
tokenizers = {
|
33 |
-
"Polygraf AI
|
34 |
-
"Polygraf AI
|
35 |
}
|
36 |
|
37 |
|
@@ -151,8 +151,8 @@ def process_text(text, model="BC Original"):
|
|
151 |
|
152 |
|
153 |
ai_check_options = [
|
154 |
-
"Polygraf AI
|
155 |
-
"Polygraf AI
|
156 |
]
|
157 |
|
158 |
|
@@ -202,7 +202,7 @@ def ai_generated_test_gptzero(text):
|
|
202 |
return result, None
|
203 |
|
204 |
|
205 |
-
def highlighter_polygraf(text, model="Polygraf AI
|
206 |
return process_text(text=text, model=model)
|
207 |
|
208 |
|
|
|
22 |
print(f"Using device: {device}")
|
23 |
|
24 |
models = {
|
25 |
+
"Polygraf AI (Base Model)": AutoModelForSequenceClassification.from_pretrained(
|
26 |
"polygraf-ai/bc-roberta-openai-2sent"
|
27 |
).to(device),
|
28 |
+
"Polygraf AI (Advanced Model)": AutoModelForSequenceClassification.from_pretrained(
|
29 |
"polygraf-ai/bc_combined_3sent"
|
30 |
).to(device),
|
31 |
}
|
32 |
tokenizers = {
|
33 |
+
"Polygraf AI (Base Model)": AutoTokenizer.from_pretrained("polygraf-ai/bc-roberta-openai-2sent"),
|
34 |
+
"Polygraf AI (Advanced Model)": AutoTokenizer.from_pretrained("polygraf-ai/bc_combined_3sent"),
|
35 |
}
|
36 |
|
37 |
|
|
|
151 |
|
152 |
|
153 |
ai_check_options = [
|
154 |
+
"Polygraf AI (Base Model)",
|
155 |
+
"Polygraf AI (Advanced Model)",
|
156 |
]
|
157 |
|
158 |
|
|
|
202 |
return result, None
|
203 |
|
204 |
|
205 |
+
def highlighter_polygraf(text, model="Polygraf AI (Base Model)"):
|
206 |
return process_text(text=text, model=model)
|
207 |
|
208 |
|