gemma-3n-vneid-merged

๐Ÿ‡ป๐Ÿ‡ณ Vietnamese Fine-tuned Gemma Model

This is a Vietnamese fine-tuned version of Google's Gemma 2B model using Unsloth and LoRA adapters, optimized for Vietnamese text generation.

๐Ÿ“Š Model Details

  • Base Model: google/gemma-2-2b
  • Language: Vietnamese (vi)
  • Fine-tuning Method: LoRA (Low-Rank Adaptation)
  • Framework: Unsloth
  • Model Type: Causal Language Model
  • License: Apache 2.0

๐Ÿš€ Quick Start

Using Transformers

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Load model and tokenizer
model_name = "anhtuan15082023/gemma-3n-vneid-merged"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.float16,
    device_map="auto",
    trust_remote_code=True
)

# Generate Vietnamese text
def generate_vietnamese_text(prompt, max_length=100):
    inputs = tokenizer(prompt, return_tensors="pt")
    
    with torch.no_grad():
        outputs = model.generate(
            **inputs,
            max_length=max_length,
            temperature=0.7,
            do_sample=True,
            top_p=0.9,
            pad_token_id=tokenizer.eos_token_id
        )
    
    response = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return response[len(prompt):].strip()

# Example usage
prompt = "Xin chร o, tรดi lร "
result = generate_vietnamese_text(prompt)
print(f"Input: {prompt}")
print(f"Output: {result}")

Using Inference API

import requests

API_URL = "https://api-inference.huggingface.co/models/anhtuan15082023/gemma-3n-vneid-merged"
headers = {"Authorization": f"Bearer {YOUR_HF_TOKEN}"}

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

# Generate text
output = query({
    "inputs": "Viแป‡t Nam lร ",
    "parameters": {
        "max_length": 100,
        "temperature": 0.7
    }
})
print(output)

๐ŸŽฏ Use Cases

  • Vietnamese text completion
  • Creative writing in Vietnamese
  • Chatbot responses in Vietnamese
  • Content generation for Vietnamese applications

โš™๏ธ Training Details

  • Dataset: Vietnamese text corpus
  • Training Framework: Unsloth (optimized training)
  • Fine-tuning Method: LoRA adapters merged into base model
  • Base Model: Google Gemma 2B

๐Ÿท๏ธ Model Tags

  • Vietnamese language model
  • Text generation
  • Fine-tuned Gemma
  • LoRA adaptation

๐Ÿ“œ License

This model inherits the Apache 2.0 license from the base Gemma model.

๐Ÿค Citation

If you use this model, please consider citing:

@model{vietnamese-gemma-finetuned,
  title={Vietnamese Fine-tuned Gemma Model},
  author={anhtuan15082023},
  year={2024},
  url={https://huggingface.co/anhtuan15082023/gemma-3n-vneid-merged}
}

๐Ÿ“ž Contact

For questions or issues, please open an issue on the model's repository page.

Downloads last month
14
Safetensors
Model size
0.3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for anhtuan15082023/gemma-3n-vneid-merged

Adapter
(242)
this model