NoaiGPT commited on
Commit
17b0e6e
·
1 Parent(s): 02a8691
Files changed (1) hide show
  1. app.py +2 -2
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, TFDistilBertForSequenceClassification, DistilBertTokenizerFast
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 = TFDistilBertForSequenceClassification.from_pretrained(model_name, from_tf=True)
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)