Amitontheweb commited on
Commit
2ee9bcb
1 Parent(s): bf0c3af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -129,8 +129,8 @@ def generate(input_text, number_steps, number_beams, number_beam_groups, diversi
129
  def load_model(model_selected):
130
 
131
  if model_selected == "gpt2":
132
- tokenizer = AutoTokenizer.from_pretrained("gpt2")
133
- model = AutoModelForCausalLM.from_pretrained("gpt2", pad_token_id=tokenizer.eos_token_id)
134
  #print (model_selected + " loaded")
135
 
136
  if model_selected == "Gemma 2":
@@ -294,8 +294,8 @@ with gr.Blocks() as demo:
294
  value="It's a rainy day today",
295
  )
296
 
297
- tokenizer = AutoTokenizer.from_pretrained("gpt2")
298
- model = AutoModelForCausalLM.from_pretrained("gpt2", pad_token_id=tokenizer.eos_token_id, cache_dir=cache_dir).to(torch_device)
299
 
300
 
301
  with gr.Row():
 
129
  def load_model(model_selected):
130
 
131
  if model_selected == "gpt2":
132
+ tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
133
+ model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2", pad_token_id=tokenizer.eos_token_id)
134
  #print (model_selected + " loaded")
135
 
136
  if model_selected == "Gemma 2":
 
294
  value="It's a rainy day today",
295
  )
296
 
297
+ tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
298
+ model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2", pad_token_id=tokenizer.eos_token_id)
299
 
300
 
301
  with gr.Row():