Spaces:
Runtime error
Runtime error
asd
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ import gradio as gr
|
|
54 |
from openai import OpenAI
|
55 |
import os
|
56 |
import re
|
57 |
-
from transformers import pipeline,
|
58 |
|
59 |
# define the openai key
|
60 |
api_key = "sk-proj-UCoZZMs4MyfyHwXdHjT8T3BlbkFJjYkSZyPfIPNqXfXwoekm"
|
@@ -67,7 +67,7 @@ finetuned_model = "ft:gpt-3.5-turbo-0125:personal::9qGC8cwZ"
|
|
67 |
|
68 |
# Load the AI detection model
|
69 |
model_name = "tommyliphys/ai-detector-distilbert"
|
70 |
-
model =
|
71 |
tokenizer = DistilBertTokenizerFast.from_pretrained(model_name)
|
72 |
|
73 |
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
|
|
54 |
from openai import OpenAI
|
55 |
import os
|
56 |
import re
|
57 |
+
from transformers import pipeline, DistilBertForSequenceClassification, DistilBertTokenizerFast
|
58 |
|
59 |
# define the openai key
|
60 |
api_key = "sk-proj-UCoZZMs4MyfyHwXdHjT8T3BlbkFJjYkSZyPfIPNqXfXwoekm"
|
|
|
67 |
|
68 |
# Load the AI detection model
|
69 |
model_name = "tommyliphys/ai-detector-distilbert"
|
70 |
+
model = DistilBertForSequenceClassification.from_pretrained(model_name)
|
71 |
tokenizer = DistilBertTokenizerFast.from_pretrained(model_name)
|
72 |
|
73 |
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|