Spaces:
Runtime error
Runtime error
TomokiFujihara
commited on
Commit
β’
f8efa7c
1
Parent(s):
1272055
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,12 @@ from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
|
3 |
import torch
|
4 |
import numpy as np
|
5 |
import gradio as gr
|
|
|
|
|
6 |
|
7 |
# γγΌγ―γγ€γΆγΌγ¨γ’γγ«γγγΌγγγ
|
8 |
tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-japanese-base-lite")
|
9 |
-
model = AutoModelForSequenceClassification.from_pretrained("TomokiFujihara/luke-japanese-base-lite-offensiveness-estimation", trust_remote_code=True, use_auth_token=
|
10 |
|
11 |
# txtε
₯εγεγεγγγγγδ½Ώη¨γγ¦ζ°γγtxtγηζγγι’ζ°
|
12 |
def generate(text):
|
|
|
3 |
import torch
|
4 |
import numpy as np
|
5 |
import gradio as gr
|
6 |
+
import os
|
7 |
+
SECRET_TOKEN = os.getenv("TOKEN_OFFENSIVENESS_ESTIMATION")
|
8 |
|
9 |
# γγΌγ―γγ€γΆγΌγ¨γ’γγ«γγγΌγγγ
|
10 |
tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-japanese-base-lite")
|
11 |
+
model = AutoModelForSequenceClassification.from_pretrained("TomokiFujihara/luke-japanese-base-lite-offensiveness-estimation", trust_remote_code=True, use_auth_token=SECRET_TOKEN)
|
12 |
|
13 |
# txtε
₯εγεγεγγγγγδ½Ώη¨γγ¦ζ°γγtxtγηζγγι’ζ°
|
14 |
def generate(text):
|