Model Card for llama-1.1B-chat-guanaco

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.

Model Details

Model Description

  • Developed by: Athos Pugliese
  • Model type: Modelo de linguagem autoregressive com 1.1B parâmetros
  • Language(s): Inglês
  • License: [Mesma licença do modelo base ou sua escolha]
  • Finetuned from model: TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T

O modelo foi fine-tuned usando Parameter-Efficient Fine-Tuning (PEFT) com LoRA (Low-Rank Adaptation), permitindo adaptar o modelo com recursos computacionais limitados.

Model Sources

Uses

Direct Use

Este modelo pode ser usado para:

  • Assistente de conversação
  • Responder perguntas de conhecimento geral
  • Explicar conceitos em termos simples
  • Completar tarefas baseadas em instruções de texto

Input Format

O modelo espera instruções no formato: [INST] sua pergunta ou instrução aqui [/INST]

Training Details

Training Data

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.

Training Procedure

Training Hyperparameters

  • Método PEFT: LoRA (Low-Rank Adaptation)
  • Rank LoRA (r): 64
  • Alpha LoRA: 16
  • Dropout LoRA: 0.1
  • Target Modules: q_proj, v_proj, k_proj, o_proj
  • Épocas: 2
  • Batch size por dispositivo: 4
  • Gradient Accumulation Steps: 8
  • Learning rate: 2e-4
  • Optimizer: AdamW
  • Scheduler: Cosine
  • Warmup ratio: 0.03
  • Weight decay: 0.001
  • Gradient clipping: 0.3
  • Precision: fp16

Hardware

  • GPU: NVIDIA T4 16GB

Performance and Limitations

Capabilities

O modelo é capaz de:

  • Responder perguntas de conhecimento geral
  • Manter conversas básicas
  • Fornecer explicações simplificadas
  • Seguir instruções textuais simples

Limitations

  • Como um modelo pequeno (1.1B de parâmetros), tem capacidades de raciocínio e conhecimento limitadas
  • Pode gerar informações factuais incorretas
  • O conhecimento do modelo é limitado aos dados de treinamento
  • Pode apresentar vieses presentes nos dados de treinamento
  • Não é otimizado para tarefas específicas além de conversação geral

How to Get Started with the Model

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 (17921815). 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: athospugliesedev@gmail.com
GitHub: github.com/athospugliese
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support