Spaces:
Runtime error
Runtime error
Commit
·
0e4ed09
1
Parent(s):
6680f7e
add token
Browse files
app.py
CHANGED
@@ -276,6 +276,7 @@ en_stopwords = set(
|
|
276 |
import multiprocessing
|
277 |
import os
|
278 |
|
|
|
279 |
import tqdm
|
280 |
import whoosh.index as whoosh_index
|
281 |
from whoosh.analysis import StemmingAnalyzer
|
@@ -347,12 +348,12 @@ from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
|
347 |
|
348 |
safety_tokenizer = tokenizer = AutoTokenizer.from_pretrained(
|
349 |
"salexashenko/T5-Base-ROT-epoch-2-train-loss-1.3495-val-loss-1.4164",
|
350 |
-
use_auth_token=
|
351 |
)
|
352 |
safety_model = model = (
|
353 |
AutoModelForSeq2SeqLM.from_pretrained(
|
354 |
"salexashenko/T5-Base-ROT-epoch-2-train-loss-1.3495-val-loss-1.4164",
|
355 |
-
use_auth_token=
|
356 |
)
|
357 |
.half()
|
358 |
.cuda()
|
|
|
276 |
import multiprocessing
|
277 |
import os
|
278 |
|
279 |
+
HF_TOKEN = os.getenv("HUGGING_FACE_HUB_TOKEN")
|
280 |
import tqdm
|
281 |
import whoosh.index as whoosh_index
|
282 |
from whoosh.analysis import StemmingAnalyzer
|
|
|
348 |
|
349 |
safety_tokenizer = tokenizer = AutoTokenizer.from_pretrained(
|
350 |
"salexashenko/T5-Base-ROT-epoch-2-train-loss-1.3495-val-loss-1.4164",
|
351 |
+
use_auth_token=HF_TOKEN,
|
352 |
)
|
353 |
safety_model = model = (
|
354 |
AutoModelForSeq2SeqLM.from_pretrained(
|
355 |
"salexashenko/T5-Base-ROT-epoch-2-train-loss-1.3495-val-loss-1.4164",
|
356 |
+
use_auth_token=HF_TOKEN,
|
357 |
)
|
358 |
.half()
|
359 |
.cuda()
|