Text Generation
PEFT
Safetensors
Transformers
llama
lora
sft
trl
unsloth
conversational
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use DavidLanz/llama3.2_3B_news_qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use DavidLanz/llama3.2_3B_news_qlora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "DavidLanz/llama3.2_3B_news_qlora") - Transformers
How to use DavidLanz/llama3.2_3B_news_qlora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DavidLanz/llama3.2_3B_news_qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("DavidLanz/llama3.2_3B_news_qlora") model = AutoModelForMultimodalLM.from_pretrained("DavidLanz/llama3.2_3B_news_qlora") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DavidLanz/llama3.2_3B_news_qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DavidLanz/llama3.2_3B_news_qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavidLanz/llama3.2_3B_news_qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DavidLanz/llama3.2_3B_news_qlora
- SGLang
How to use DavidLanz/llama3.2_3B_news_qlora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DavidLanz/llama3.2_3B_news_qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavidLanz/llama3.2_3B_news_qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "DavidLanz/llama3.2_3B_news_qlora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavidLanz/llama3.2_3B_news_qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use DavidLanz/llama3.2_3B_news_qlora 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 DavidLanz/llama3.2_3B_news_qlora 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 DavidLanz/llama3.2_3B_news_qlora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for DavidLanz/llama3.2_3B_news_qlora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="DavidLanz/llama3.2_3B_news_qlora", max_seq_length=2048, ) - Docker Model Runner
How to use DavidLanz/llama3.2_3B_news_qlora with Docker Model Runner:
docker model run hf.co/DavidLanz/llama3.2_3B_news_qlora
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- adapter_config.json +9 -5
README.md
CHANGED
|
@@ -207,4 +207,4 @@ Carbon emissions can be estimated using the [Machine Learning Impact calculator]
|
|
| 207 |
[More Information Needed]
|
| 208 |
### Framework versions
|
| 209 |
|
| 210 |
-
- PEFT 0.17.
|
|
|
|
| 207 |
[More Information Needed]
|
| 208 |
### Framework versions
|
| 209 |
|
| 210 |
+
- PEFT 0.17.1
|
adapter_config.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
{
|
| 2 |
"alpha_pattern": {},
|
| 3 |
-
"auto_mapping":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
"base_model_name_or_path": "unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit",
|
| 5 |
"bias": "none",
|
| 6 |
"corda_config": null,
|
|
@@ -25,13 +29,13 @@
|
|
| 25 |
"rank_pattern": {},
|
| 26 |
"revision": null,
|
| 27 |
"target_modules": [
|
| 28 |
-
"gate_proj",
|
| 29 |
"up_proj",
|
| 30 |
-
"
|
| 31 |
"o_proj",
|
|
|
|
|
|
|
| 32 |
"down_proj",
|
| 33 |
-
"
|
| 34 |
-
"q_proj"
|
| 35 |
],
|
| 36 |
"target_parameters": null,
|
| 37 |
"task_type": "CAUSAL_LM",
|
|
|
|
| 1 |
{
|
| 2 |
"alpha_pattern": {},
|
| 3 |
+
"auto_mapping": {
|
| 4 |
+
"base_model_class": "LlamaForCausalLM",
|
| 5 |
+
"parent_library": "transformers.models.llama.modeling_llama",
|
| 6 |
+
"unsloth_fixed": true
|
| 7 |
+
},
|
| 8 |
"base_model_name_or_path": "unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit",
|
| 9 |
"bias": "none",
|
| 10 |
"corda_config": null,
|
|
|
|
| 29 |
"rank_pattern": {},
|
| 30 |
"revision": null,
|
| 31 |
"target_modules": [
|
|
|
|
| 32 |
"up_proj",
|
| 33 |
+
"v_proj",
|
| 34 |
"o_proj",
|
| 35 |
+
"q_proj",
|
| 36 |
+
"k_proj",
|
| 37 |
"down_proj",
|
| 38 |
+
"gate_proj"
|
|
|
|
| 39 |
],
|
| 40 |
"target_parameters": null,
|
| 41 |
"task_type": "CAUSAL_LM",
|