Spaces:
Running
Running
JaphetHernandez
commited on
Commit
•
af9e54e
1
Parent(s):
88945d3
Update app.py
Browse files
app.py
CHANGED
@@ -13,11 +13,11 @@ login(huggingface_token)# Autenticar
|
|
13 |
|
14 |
# Configurar modelo Llama 3.1
|
15 |
model_id = "meta-llama/Llama-3.2-1B"
|
16 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
17 |
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.float16)
|
18 |
|
19 |
# Crear pipeline con Fireworks
|
20 |
-
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, max_new_tokens=50
|
21 |
llm_pipeline = HuggingFacePipeline(pipeline=pipe)
|
22 |
|
23 |
# Interfaz de Streamlit
|
|
|
13 |
|
14 |
# Configurar modelo Llama 3.1
|
15 |
model_id = "meta-llama/Llama-3.2-1B"
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, truncation=True))
|
17 |
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", torch_dtype=torch.float16)
|
18 |
|
19 |
# Crear pipeline con Fireworks
|
20 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, max_new_tokens=50) #, max_length=1024)
|
21 |
llm_pipeline = HuggingFacePipeline(pipeline=pipe)
|
22 |
|
23 |
# Interfaz de Streamlit
|