freQuensy23 commited on
Commit
b8d1d3d
1 Parent(s): 2219bdc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import gradio as gr
2
  import transformers
3
  import peft
 
4
 
5
  model_id = 'freQuensy23/toxic-llama2'
6
- model = peft.AutoPeftModelForCausalLM.from_pretrained(model_id)
7
  model.to_bettertransformer()
8
- tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
9
 
10
 
11
  def generate(text, temp):
 
1
  import gradio as gr
2
  import transformers
3
  import peft
4
+ import os
5
 
6
  model_id = 'freQuensy23/toxic-llama2'
7
+ model = peft.AutoPeftModelForCausalLM.from_pretrained(model_id, token=os.getenv('hf_token'))
8
  model.to_bettertransformer()
9
+ tokenizer = transformers.AutoTokenizer.from_pretrained(model_id, token=os.getenv('hf_token'))
10
 
11
 
12
  def generate(text, temp):