app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
4 |
-
# Load the model and tokenizer
|
5 |
model_name = "deepseek-ai/DeepSeek-R1"
|
6 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
7 |
-
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
8 |
|
9 |
def classify_text(input_text):
|
10 |
# Tokenize the input
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
4 |
+
# Load the model and tokenizer with `trust_remote_code=True`
|
5 |
model_name = "deepseek-ai/DeepSeek-R1"
|
6 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
7 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name, trust_remote_code=True)
|
8 |
|
9 |
def classify_text(input_text):
|
10 |
# Tokenize the input
|