JOM669 commited on
Commit
e3fc6ff
1 Parent(s): f0c7d57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,10 +1,12 @@
1
  import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
3
 
4
  # Cargar el modelo y el tokenizer
5
  model_id = "meta-llama/Llama-3.2-1B"
6
- tokenizer = AutoTokenizer.from_pretrained(model_id)
7
- model = AutoModelForCausalLM.from_pretrained(model_id)
8
 
9
  def generate_text(prompt):
10
  inputs = tokenizer(prompt, return_tensors="pt")
 
1
  import gradio as gr
2
  from transformers import AutoModelForCausalLM, AutoTokenizer
3
+ import os
4
+
5
 
6
  # Cargar el modelo y el tokenizer
7
  model_id = "meta-llama/Llama-3.2-1B"
8
+ tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=os.getenv("TOKEN"))
9
+ model = AutoModelForCausalLM.from_pretrained(model_id, use_auth_token=os.getenv("TOKEN"))
10
 
11
  def generate_text(prompt):
12
  inputs = tokenizer(prompt, return_tensors="pt")