|
--- |
|
library_name: transformers |
|
tags: |
|
- ultrachat |
|
datasets: |
|
- HuggingFaceH4/ultrachat_200k |
|
base_model: |
|
- TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T |
|
--- |
|
|
|
# Model Card for Model ID |
|
|
|
This is quantized adapters trained on the Ultrachat 200k dataset for the TinyLlama-1.1B Intermediate Step 1431k 3T model. |
|
|
|
```python |
|
adapter_name = 'iqbalamo93/TinyLlama-1.1B-intermediate-1431k-3T-adapters-ultrachat' |
|
``` |
|
|
|
## Model Details |
|
|
|
Base model was quantized using BitsAndBytes |
|
|
|
```python |
|
from bitsandbytes import BitsAndBytesConfig |
|
|
|
bnb_config = BitsAndBytesConfig( |
|
load_in_4bit=True, # Use 4-bit precision model loading |
|
bnb_4bit_quant_type="nf4", # Quantization type |
|
bnb_4bit_compute_dtype="float16", # Compute data type |
|
bnb_4bit_use_double_quant=True # Apply nested quantization |
|
) |
|
``` |
|
|
|
### Model Description |
|
This is quantized adapters trained on the Ultrachat 200k dataset for the TinyLlama-1.1B Intermediate Step 1431k 3T model. |
|
|
|
- Finetuned from model : [TinyLlama](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-1431k-3T) |
|
|
|
### How to use |
|
|
|
#### Method 1: Direct loading |
|
```python |
|
from peft import PeftModel, AutoPeftModelForCausalLM |
|
from transformers import pipeline, AutoTokenizer |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0") |
|
adapter_name = 'iqbalamo93/TinyLlama-1.1B-intermediate-1431k-3T-adapters-ultrachat' |
|
model = AutoPeftModelForCausalLM.from_pretrained( |
|
adapter_name, |
|
device_map="auto" |
|
) |
|
model = model.merge_and_unload() |
|
|
|
prompt = """<|user|> |
|
Tell me something about Large Language Models.</s> |
|
<|assistant|> |
|
""" |
|
|
|
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer) |
|
print(pipe(prompt)[0]["generated_text"]) |
|
|
|
``` |
|
#### Method 2: Merging with base mode explicitly |
|
todo |