Instructions to use oswaldoludwig/kappatune-lora-tinyllama-agnews with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use oswaldoludwig/kappatune-lora-tinyllama-agnews with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0") model = PeftModel.from_pretrained(base_model, "oswaldoludwig/kappatune-lora-tinyllama-agnews") - Transformers
How to use oswaldoludwig/kappatune-lora-tinyllama-agnews with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="oswaldoludwig/kappatune-lora-tinyllama-agnews") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("oswaldoludwig/kappatune-lora-tinyllama-agnews", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use oswaldoludwig/kappatune-lora-tinyllama-agnews with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "oswaldoludwig/kappatune-lora-tinyllama-agnews" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oswaldoludwig/kappatune-lora-tinyllama-agnews", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/oswaldoludwig/kappatune-lora-tinyllama-agnews
- SGLang
How to use oswaldoludwig/kappatune-lora-tinyllama-agnews 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 "oswaldoludwig/kappatune-lora-tinyllama-agnews" \ --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": "oswaldoludwig/kappatune-lora-tinyllama-agnews", "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 "oswaldoludwig/kappatune-lora-tinyllama-agnews" \ --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": "oswaldoludwig/kappatune-lora-tinyllama-agnews", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use oswaldoludwig/kappatune-lora-tinyllama-agnews with Docker Model Runner:
docker model run hf.co/oswaldoludwig/kappatune-lora-tinyllama-agnews
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,9 +31,9 @@ This model is a fine-tuned version of [TinyLlama/TinyLlama-1.1B-Chat-v1.0](https
|
|
| 31 |
## Model description
|
| 32 |
|
| 33 |
This model is a LoRA (Low-Rank Adaptation) adapter applied to TinyLlama-1.1B. Unlike standard LoRA, which targets manually specified module types (e.g., all `q_proj` or `v_proj` layers), this adapter was trained using the **KappaTune PEFT Integration**.
|
| 34 |
-
Before training, the KappaTune algorithm performed a Singular Value Decomposition (SVD) on all candidate weight matrices to calculate their **Condition Number (
|
| 35 |
-
* **High-
|
| 36 |
-
* **Low-
|
| 37 |
|
| 38 |
This targeted approach ensures the model learns the new domain efficiently while preserving its foundational conversational capabilities.
|
| 39 |
|
|
|
|
| 31 |
## Model description
|
| 32 |
|
| 33 |
This model is a LoRA (Low-Rank Adaptation) adapter applied to TinyLlama-1.1B. Unlike standard LoRA, which targets manually specified module types (e.g., all `q_proj` or `v_proj` layers), this adapter was trained using the **KappaTune PEFT Integration**.
|
| 34 |
+
Before training, the KappaTune algorithm performed a Singular Value Decomposition (SVD) on all candidate weight matrices to calculate their **Condition Number (kappa)**.
|
| 35 |
+
* **High-kappa** tensors (highly specialized, anisotropic weights containing pre-trained knowledge) were frozen.
|
| 36 |
+
* **Low-kappa** tensors (numerically stable, general-purpose weights of higher output entropy acting as a "raw marble block") were selected for LoRA adaptation.
|
| 37 |
|
| 38 |
This targeted approach ensures the model learns the new domain efficiently while preserving its foundational conversational capabilities.
|
| 39 |
|