Instructions to use samadpls/torchlight-phi4-mini-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use samadpls/torchlight-phi4-mini-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-4-mini-instruct") model = PeftModel.from_pretrained(base_model, "samadpls/torchlight-phi4-mini-lora") - MLX
How to use samadpls/torchlight-phi4-mini-lora with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("samadpls/torchlight-phi4-mini-lora") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use samadpls/torchlight-phi4-mini-lora with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "samadpls/torchlight-phi4-mini-lora" --prompt "Once upon a time"
- Atomic Chat
Download adapter_config.json from samadpls/torchlight-phi4-mini-lora: direct link, hf CLI and curl.
- Browser
- Download file 2.81 kB
-
https://huggingface.co/samadpls/torchlight-phi4-mini-lora/resolve/main/adapter_config.json
- Command line
-
hf download hf://samadpls/torchlight-phi4-mini-lora/adapter_config.json
-
curl -L -o adapter_config.json https://huggingface.co/samadpls/torchlight-phi4-mini-lora/resolve/main/adapter_config.json
2.81 kB
| { | |
| "peft_type": "LORA", | |
| "task_type": "CAUSAL_LM", | |
| "base_model_name_or_path": "microsoft/Phi-4-mini-instruct", | |
| "r": 16, | |
| "lora_alpha": 32.0, | |
| "lora_dropout": 0.0, | |
| "bias": "none", | |
| "fan_in_fan_out": false, | |
| "inference_mode": true, | |
| "target_modules": [ | |
| "model.layers.16.mlp.down_proj", | |
| "model.layers.16.mlp.gate_up_proj", | |
| "model.layers.16.self_attn.o_proj", | |
| "model.layers.16.self_attn.qkv_proj", | |
| "model.layers.17.mlp.down_proj", | |
| "model.layers.17.mlp.gate_up_proj", | |
| "model.layers.17.self_attn.o_proj", | |
| "model.layers.17.self_attn.qkv_proj", | |
| "model.layers.18.mlp.down_proj", | |
| "model.layers.18.mlp.gate_up_proj", | |
| "model.layers.18.self_attn.o_proj", | |
| "model.layers.18.self_attn.qkv_proj", | |
| "model.layers.19.mlp.down_proj", | |
| "model.layers.19.mlp.gate_up_proj", | |
| "model.layers.19.self_attn.o_proj", | |
| "model.layers.19.self_attn.qkv_proj", | |
| "model.layers.20.mlp.down_proj", | |
| "model.layers.20.mlp.gate_up_proj", | |
| "model.layers.20.self_attn.o_proj", | |
| "model.layers.20.self_attn.qkv_proj", | |
| "model.layers.21.mlp.down_proj", | |
| "model.layers.21.mlp.gate_up_proj", | |
| "model.layers.21.self_attn.o_proj", | |
| "model.layers.21.self_attn.qkv_proj", | |
| "model.layers.22.mlp.down_proj", | |
| "model.layers.22.mlp.gate_up_proj", | |
| "model.layers.22.self_attn.o_proj", | |
| "model.layers.22.self_attn.qkv_proj", | |
| "model.layers.23.mlp.down_proj", | |
| "model.layers.23.mlp.gate_up_proj", | |
| "model.layers.23.self_attn.o_proj", | |
| "model.layers.23.self_attn.qkv_proj", | |
| "model.layers.24.mlp.down_proj", | |
| "model.layers.24.mlp.gate_up_proj", | |
| "model.layers.24.self_attn.o_proj", | |
| "model.layers.24.self_attn.qkv_proj", | |
| "model.layers.25.mlp.down_proj", | |
| "model.layers.25.mlp.gate_up_proj", | |
| "model.layers.25.self_attn.o_proj", | |
| "model.layers.25.self_attn.qkv_proj", | |
| "model.layers.26.mlp.down_proj", | |
| "model.layers.26.mlp.gate_up_proj", | |
| "model.layers.26.self_attn.o_proj", | |
| "model.layers.26.self_attn.qkv_proj", | |
| "model.layers.27.mlp.down_proj", | |
| "model.layers.27.mlp.gate_up_proj", | |
| "model.layers.27.self_attn.o_proj", | |
| "model.layers.27.self_attn.qkv_proj", | |
| "model.layers.28.mlp.down_proj", | |
| "model.layers.28.mlp.gate_up_proj", | |
| "model.layers.28.self_attn.o_proj", | |
| "model.layers.28.self_attn.qkv_proj", | |
| "model.layers.29.mlp.down_proj", | |
| "model.layers.29.mlp.gate_up_proj", | |
| "model.layers.29.self_attn.o_proj", | |
| "model.layers.29.self_attn.qkv_proj", | |
| "model.layers.30.mlp.down_proj", | |
| "model.layers.30.mlp.gate_up_proj", | |
| "model.layers.30.self_attn.o_proj", | |
| "model.layers.30.self_attn.qkv_proj", | |
| "model.layers.31.mlp.down_proj", | |
| "model.layers.31.mlp.gate_up_proj", | |
| "model.layers.31.self_attn.o_proj", | |
| "model.layers.31.self_attn.qkv_proj" | |
| ] | |
| } | |