Downloads · 30 days
0
riyampatel2001/llama_ros2
llama_ros2 is a machine learning model from riyampatel2001. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a LoRA adapter trained on ROS2 navigation tasks. To use this model:
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2024
Repo size
13.3 MB
Likes
0
Public
Click a slice to open those files.
.safetensors16.8 MB · 65%
From the Hugging Face model README
This is a LoRA adapter trained on ROS2 navigation tasks. To use this model:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel, PeftConfig
import torch
# Configure quantization
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True,
)
# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-2-7b-hf",
quantization_config=bnb_config,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(
base_model,
"riyampatel2001/llama_ros2",
device_map="auto"
)
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf")
```