Downloads · 30 days
0
athospugliese/llama-1.1B-chat-guanaco
llama-1.1B-chat-guanaco is a machine learning model from athospugliese. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Este modelo é uma versão fine-tuned do TinyLlama-1.1B usando o conjunto de dados Guanaco para melhorar suas capacidades de chat e resposta a instruções.
Downloads · 30 days
0
Access
Public
Updated Sep 20, 2025
Repo size
72.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors72.1 MB · 95%
From the Hugging Face model README
Este modelo é uma versão fine-tuned do TinyLlama-1.1B usando o conjunto de dados Guanaco para melhorar suas capacidades de chat e resposta a instruções.
O modelo foi fine-tuned usando Parameter-Efficient Fine-Tuning (PEFT) com LoRA (Low-Rank Adaptation), permitindo adaptar o modelo com recursos computacionais limitados.
Este modelo pode ser usado para:
O modelo espera instruções no formato: [INST] sua pergunta ou instrução aqui [/INST]
O modelo foi fine-tuned usando o dataset Guanaco-Llama2-1k, uma coleção de 1.000 exemplos de conversação de alta qualidade derivados do formato de instruções Llama2.
O modelo é capaz de:
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig
import torch
# Carregar a configuração PEFT
config = PeftConfig.from_pretrained("caminho/para/llama-1.1B-chat-guanaco")
# Carregar o modelo base
base_model = AutoModelForCausalLM.from_pretrained(
config.base_model_name_or_path,
torch_dtype=torch.float16,
device_map="auto"
)
# Aplicar o adaptador LoRA
model = PeftModel.from_pretrained(base_model, "caminho/para/llama-1.1B-chat-guanaco")
# Carregar o tokenizer
tokenizer = AutoTokenizer.from_pretrained("caminho/para/llama-1.1B-chat-guanaco")
tokenizer.pad_token = tokenizer.eos_token
# Função para gerar respostas
def generate_response(prompt, max_length=200):
inputs = tokenizer(f"<s>[INST] {prompt} [/INST]", return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=max_length,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.2
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
response = response.split("[/INST]")[-1].strip()
return response
# Exemplo
prompt = "Explain quantum computing in simple terms."
print(generate_response(prompt))
Exemplos
Prompt: Who is Napoleon Bonaparte?
Resposta: Napoleon was the French version of his name. He was a famous general and statesman who led France to victory in several wars, including the Napoleonic Wars (1792–1815). In 1804 he declared himself emperor of the French Empire.
Prompt: Explain quantum computing in simple terms.
Resposta: Quantum computers are machines that use quantum mechanics to perform calculations faster than conventional computers and allow for the creation of complex algorithms, such as those used by AI systems like Google's DeepMind.
Quantum computing uses qubits, or "qubit states," which can be in a superposition state (i.e., they can have both an up and down spin) rather than being either on or off. This allows for more efficient processing, since it enables the computer to take advantage of the properties of quantum physics instead of relying solely on classical logic.
Model Card Contact
Developer: Athos Pugliese
Email: [email protected]
GitHub: github.com/athospugliese