Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import gradio as gr
|
|
| 2 |
import torch
|
| 3 |
import transformers
|
| 4 |
import spaces
|
| 5 |
-
from synthid_text import
|
| 6 |
from synthid_text.detector_mean import mean_score
|
| 7 |
|
| 8 |
# Configurations and model selection
|
|
@@ -13,11 +13,11 @@ TOP_P = 0.99
|
|
| 13 |
TEMPERATURE= 0.5
|
| 14 |
|
| 15 |
# Initialize model and tokenizer
|
| 16 |
-
model = synthid_mixin.SynthIDGemmaForCausalLM.from_pretrained(
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
)
|
| 21 |
tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME)
|
| 22 |
tokenizer.pad_token = tokenizer.eos_token
|
| 23 |
tokenizer.padding_side = "left"
|
|
|
|
| 2 |
import torch
|
| 3 |
import transformers
|
| 4 |
import spaces
|
| 5 |
+
from synthid_text import logits_processing
|
| 6 |
from synthid_text.detector_mean import mean_score
|
| 7 |
|
| 8 |
# Configurations and model selection
|
|
|
|
| 13 |
TEMPERATURE= 0.5
|
| 14 |
|
| 15 |
# Initialize model and tokenizer
|
| 16 |
+
# model = synthid_mixin.SynthIDGemmaForCausalLM.from_pretrained(
|
| 17 |
+
# MODEL_NAME,
|
| 18 |
+
# device_map=DEVICE,
|
| 19 |
+
# torch_dtype=torch.bfloat16,
|
| 20 |
+
# )
|
| 21 |
tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME)
|
| 22 |
tokenizer.pad_token = tokenizer.eos_token
|
| 23 |
tokenizer.padding_side = "left"
|