VinaLLaMA-7B Vietnamese Merged Model

Merged VinaLLaMA-7B model fine-tuned for Vietnamese language tasks.

Model Details

  • Base Model: vilm/vinallama-7b-chat
  • Fine-tuning Method: LoRA (merged with base model)
  • Language: Vietnamese
  • Training Data: Alpaca + ViQuAD
  • Model Type: Causal Language Model
  • License: MIT

Usage

Direct Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

# Load the merged model directly
model = AutoModelForCausalLM.from_pretrained("Key1111/vinallama-vietnamese-merged")
tokenizer = AutoTokenizer.from_pretrained("Key1111/vinallama-vietnamese-merged")

# Generate text
prompt = "Xin chào! Bạn có thể giúp tôi không?"
formatted_prompt = f"<|im_start|>user\n{{prompt}}<|im_end|>\n<|im_start|>assistant\n"

inputs = tokenizer(formatted_prompt, return_tensors="pt", truncation=True, max_length=512)
outputs = model.generate(
    **inputs,
    max_new_tokens=256,
    temperature=0.7,
    top_p=0.9,
    do_sample=True,
    pad_token_id=tokenizer.eos_token_id,
    eos_token_id=tokenizer.eos_token_id
)

response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

In n8n

Use this model directly in Hugging Face Inference nodes:

  • Model: Key1111/vinallama-vietnamese-merged
  • No additional configuration needed

Inference API

import requests

API_URL = "https://api-inference.huggingface.co/models/Key1111/vinallama-vietnamese-merged"
headers = {"Authorization": "Bearer hf_xxx"}

def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()

output = query({
    "inputs": "Xin chào! Bạn có thể giúp tôi không?",
    "parameters": {
        "max_new_tokens": 256,
        "temperature": 0.7,
        "top_p": 0.9
    }
})

Training Details

  • Base Model: vilm/vinallama-7b-chat
  • LoRA Rank: 8
  • LoRA Alpha: 16
  • Training Data: Alpaca + ViQuAD
  • Language: Vietnamese
  • Training Method: LoRA (Low-Rank Adaptation)

Limitations

  • Model is trained on Vietnamese data and may not perform well on other languages
  • Requires significant computational resources for inference
  • May generate biased or incorrect responses

Citation

@misc{vinallama-vietnamese-merged,
  author = {Key1111},
  title = {VinaLLaMA-7B Vietnamese Merged Model},
  year = {2024},
  publisher = {Hugging Face},
  url = {https://huggingface.co/Key1111/vinallama-vietnamese-merged}
}
Downloads last month
13
Safetensors
Model size
6.86B params
Tensor type
F16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 1 Ask for provider support

Evaluation results