Instructions to use hiieu/gemma-2-2b-it-lora-vi-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hiieu/gemma-2-2b-it-lora-vi-en with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("hiieu/gemma-2-2b-it-lora-vi-en", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Unsloth Studio new
How to use hiieu/gemma-2-2b-it-lora-vi-en with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for hiieu/gemma-2-2b-it-lora-vi-en to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for hiieu/gemma-2-2b-it-lora-vi-en to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for hiieu/gemma-2-2b-it-lora-vi-en to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="hiieu/gemma-2-2b-it-lora-vi-en", max_seq_length=2048, )
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("hiieu/gemma-2-2b-it-lora-vi-en")
tokenizer = tokenizer = AutoTokenizer.from_pretrained("hiieu/gemma-2-2b-it-lora-vi-en")
conversations = [
[{"role": "user", "content": "Good morning everybody"}],
[{"role": "user", "content": "Xin chào mọi người"}]
]
batch_input_ids = tokenizer.apply_chat_template(
conversations,
add_generation_prompt=True,
return_tensors="pt",
padding=True,
truncation=True
).to(model.device)
outputs = model.generate(
batch_input_ids,
max_new_tokens=256,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
responses = outputs[:, batch_input_ids.shape[-1]:]
for response in responses:
print(tokenizer.decode(response, skip_special_tokens=True))
>>> Chào mọi người
>>> Hello everyone
Uploaded model
- Developed by: hiieu
- License: apache-2.0
- Finetuned from model : unsloth/gemma-2-2b-it-bnb-4bit
This gemma2 model was trained 2x faster with Unsloth and Huggingface's TRL library.
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for hiieu/gemma-2-2b-it-lora-vi-en
Base model
unsloth/gemma-2-2b-it-bnb-4bit