Instructions to use dcostenco/prism-coder-14b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use dcostenco/prism-coder-14b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="dcostenco/prism-coder-14b", filename="prism-aac-14b-q4km.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use dcostenco/prism-coder-14b with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dcostenco/prism-coder-14b # Run inference directly in the terminal: llama-cli -hf dcostenco/prism-coder-14b
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dcostenco/prism-coder-14b # Run inference directly in the terminal: llama-cli -hf dcostenco/prism-coder-14b
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf dcostenco/prism-coder-14b # Run inference directly in the terminal: ./llama-cli -hf dcostenco/prism-coder-14b
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf dcostenco/prism-coder-14b # Run inference directly in the terminal: ./build/bin/llama-cli -hf dcostenco/prism-coder-14b
Use Docker
docker model run hf.co/dcostenco/prism-coder-14b
- LM Studio
- Jan
- Ollama
How to use dcostenco/prism-coder-14b with Ollama:
ollama run hf.co/dcostenco/prism-coder-14b
- Unsloth Studio
How to use dcostenco/prism-coder-14b 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 dcostenco/prism-coder-14b 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 dcostenco/prism-coder-14b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dcostenco/prism-coder-14b to start chatting
- Pi
How to use dcostenco/prism-coder-14b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dcostenco/prism-coder-14b
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "dcostenco/prism-coder-14b" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use dcostenco/prism-coder-14b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dcostenco/prism-coder-14b
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default dcostenco/prism-coder-14b
Run Hermes
hermes
- Docker Model Runner
How to use dcostenco/prism-coder-14b with Docker Model Runner:
docker model run hf.co/dcostenco/prism-coder-14b
- Lemonade
How to use dcostenco/prism-coder-14b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dcostenco/prism-coder-14b
Run and chat with the model
lemonade run user.prism-coder-14b-{{QUANT_TAG}}List all available models
lemonade list
prism-coder-14b v19 LoRA adapter — 100% BFCL
Browse files- README.md +176 -111
- adapter_config.json +45 -0
- adapter_model.safetensors +3 -0
- chat_template.jinja +61 -26
- tokenizer.json +2 -2
- tokenizer_config.json +3 -2
README.md
CHANGED
|
@@ -1,144 +1,209 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
- es
|
| 5 |
-
- fr
|
| 6 |
-
- pt
|
| 7 |
-
- de
|
| 8 |
-
- zh
|
| 9 |
-
- ja
|
| 10 |
-
- ko
|
| 11 |
-
- ru
|
| 12 |
-
- ar
|
| 13 |
-
- ro
|
| 14 |
-
- uk
|
| 15 |
-
license: apache-2.0
|
| 16 |
-
base_model: Qwen/Qwen2.5-Coder-14B-Instruct
|
| 17 |
pipeline_tag: text-generation
|
| 18 |
-
library_name: transformers
|
| 19 |
tags:
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
- prism
|
| 26 |
-
- synalux
|
| 27 |
-
- bfcl
|
| 28 |
-
- conversational
|
| 29 |
---
|
| 30 |
|
| 31 |
-
#
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
-
| You should pick this 14B if you need… | Score |
|
| 36 |
-
|---|---|
|
| 37 |
-
| **AAC realignment** for an Augmentative & Alternative Communication app | **46/48 (95.8%)** |
|
| 38 |
-
| **Non-Live AST tool-call** (parsed function signatures, multi-arg) | **55.83%** |
|
| 39 |
-
| **Live tool-call accuracy** in real-world agent prompts | **45.23%** |
|
| 40 |
-
| **Multi-tool-call** parsing in a single user turn | **44.35%** Live Multiple AST |
|
| 41 |
-
| **Irrelevance detection** — knowing when NOT to call a tool | **91.86%** ← strong |
|
| 42 |
-
| HIPAA-safe **on-device** inference at 14B-class capacity (Mac / RTX 30+) | runs on 16-24 GB RAM (Q4) |
|
| 43 |
|
| 44 |
-
**Not a leadership story on BFCL V4 overall** — frontier 70B+ models (GPT-4o, Claude Opus, Llama 3.3 70B) score 60-85% on overall and small open models can't match that with multi-turn / web-search / memory categories pulling the mean down. We score 19.29% overall, in line with the rest of the 14B class. **Pick by category fit.**
|
| 45 |
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
| 51 |
|
| 52 |
-
| Model | Use case | Context | RAM (Q4) |
|
| 53 |
-
|---|---|---|---|
|
| 54 |
-
| `prism-coder-7b` | iPad consumer AAC, free portal tier | 32K | ~5 GB |
|
| 55 |
-
| **`prism-coder-14b`** | **Mac/desktop AAC, paid portal tier (medium queries)** | **32K** | **~9 GB** |
|
| 56 |
-
| `prism-coder-32b` (in flight, Phase 1) | Synalux cloud paid-tier complex queries | 32K | ~20 GB |
|
| 57 |
|
| 58 |
-
## Eval (Prism internal, 3-run StdDev 0%)
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
| Translation | 8/8 |
|
| 68 |
-
| Ask AI | 5/5 |
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
|
| 76 |
-
##
|
| 77 |
|
| 78 |
-
|
| 79 |
-
Tier-aware routing dispatches:
|
| 80 |
-
- **Simple AAC queries** → 7B local (cheap, fast)
|
| 81 |
-
- **Medium queries (5-40 words)** → **14B local (this model)** — stronger reasoning, $0 marginal
|
| 82 |
-
- **Complex queries** → Claude Opus / Haiku per tier
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
| 87 |
-
Q4_K_M GGUF (~9 GB) fits on Mac M2/M3/M4 with ≥16 GB RAM. Runs at 15-30 tok/s — comfortable for AAC turns.
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
-
|
| 92 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 93 |
-
import torch
|
| 94 |
|
| 95 |
-
|
| 96 |
-
m = AutoModelForCausalLM.from_pretrained(
|
| 97 |
-
"dcostenco/prism-coder-14b",
|
| 98 |
-
torch_dtype=torch.bfloat16,
|
| 99 |
-
device_map="auto",
|
| 100 |
-
)
|
| 101 |
-
prompt = tok.apply_chat_template(
|
| 102 |
-
[{"role": "user", "content": "Add 'eat apples' to the food category."}],
|
| 103 |
-
tokenize=False,
|
| 104 |
-
add_generation_prompt=True,
|
| 105 |
-
)
|
| 106 |
-
inputs = tok(prompt, return_tensors="pt").to(m.device)
|
| 107 |
-
out = m.generate(**inputs, max_new_tokens=160, temperature=0.3)
|
| 108 |
-
print(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
|
| 109 |
-
```
|
| 110 |
|
| 111 |
-
|
| 112 |
|
| 113 |
-
##
|
| 114 |
|
| 115 |
-
-
|
| 116 |
-
- Method: DoRA SFT (resumed from base 14B SFT checkpoint-5000)
|
| 117 |
-
- Adapter: r=128, alpha=256, lora_dropout=0.05
|
| 118 |
-
- Schedule: 1 epoch, LR 1e-5 cosine, warmup 5%
|
| 119 |
-
- Data: glaive-function-calling-v2 + ToolACE + xlam-function-calling-60k + internal v17.1 BFCL (60K rows subsampled, Hammer-style 24% function-masked)
|
| 120 |
-
- Compute: H100×2 on Modal, ~10h total
|
| 121 |
|
| 122 |
-
|
| 123 |
|
| 124 |
-
|
| 125 |
|
| 126 |
-
|
| 127 |
|
| 128 |
-
|
| 129 |
-
@misc{prism-coder-14b-2026,
|
| 130 |
-
title = {Prism-Coder 14B: Function Calling + AAC Sibling Fine-Tune of Qwen2.5-Coder-14B},
|
| 131 |
-
author = {Synalux AI / Dmitri Costenco},
|
| 132 |
-
year = {2026},
|
| 133 |
-
month = {May},
|
| 134 |
-
url = {https://huggingface.co/dcostenco/prism-coder-14b},
|
| 135 |
-
note = {Sibling 7B model: https://huggingface.co/dcostenco/prism-coder-7b. PR: https://github.com/ShishirPatil/gorilla/pull/1332.}
|
| 136 |
-
}
|
| 137 |
-
```
|
| 138 |
|
| 139 |
-
##
|
| 140 |
|
| 141 |
-
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: Qwen/Qwen3-14B
|
| 3 |
+
library_name: peft
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
pipeline_tag: text-generation
|
|
|
|
| 5 |
tags:
|
| 6 |
+
- base_model:adapter:Qwen/Qwen3-14B
|
| 7 |
+
- lora
|
| 8 |
+
- sft
|
| 9 |
+
- transformers
|
| 10 |
+
- trl
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# Model Card for Model ID
|
| 14 |
|
| 15 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
|
|
|
| 18 |
|
| 19 |
+
## Model Details
|
| 20 |
|
| 21 |
+
### Model Description
|
| 22 |
|
| 23 |
+
<!-- Provide a longer summary of what this model is. -->
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
+
- **Developed by:** [More Information Needed]
|
| 28 |
+
- **Funded by [optional]:** [More Information Needed]
|
| 29 |
+
- **Shared by [optional]:** [More Information Needed]
|
| 30 |
+
- **Model type:** [More Information Needed]
|
| 31 |
+
- **Language(s) (NLP):** [More Information Needed]
|
| 32 |
+
- **License:** [More Information Needed]
|
| 33 |
+
- **Finetuned from model [optional]:** [More Information Needed]
|
|
|
|
|
|
|
| 34 |
|
| 35 |
+
### Model Sources [optional]
|
| 36 |
|
| 37 |
+
<!-- Provide the basic links for the model. -->
|
| 38 |
|
| 39 |
+
- **Repository:** [More Information Needed]
|
| 40 |
+
- **Paper [optional]:** [More Information Needed]
|
| 41 |
+
- **Demo [optional]:** [More Information Needed]
|
| 42 |
|
| 43 |
+
## Uses
|
| 44 |
|
| 45 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
+
### Direct Use
|
| 48 |
|
| 49 |
+
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
|
|
|
| 50 |
|
| 51 |
+
[More Information Needed]
|
| 52 |
|
| 53 |
+
### Downstream Use [optional]
|
|
|
|
|
|
|
| 54 |
|
| 55 |
+
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
+
[More Information Needed]
|
| 58 |
|
| 59 |
+
### Out-of-Scope Use
|
| 60 |
|
| 61 |
+
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
+
[More Information Needed]
|
| 64 |
|
| 65 |
+
## Bias, Risks, and Limitations
|
| 66 |
|
| 67 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 68 |
|
| 69 |
+
[More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
### Recommendations
|
| 72 |
|
| 73 |
+
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 74 |
+
|
| 75 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
| 76 |
+
|
| 77 |
+
## How to Get Started with the Model
|
| 78 |
+
|
| 79 |
+
Use the code below to get started with the model.
|
| 80 |
+
|
| 81 |
+
[More Information Needed]
|
| 82 |
+
|
| 83 |
+
## Training Details
|
| 84 |
+
|
| 85 |
+
### Training Data
|
| 86 |
+
|
| 87 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 88 |
+
|
| 89 |
+
[More Information Needed]
|
| 90 |
+
|
| 91 |
+
### Training Procedure
|
| 92 |
+
|
| 93 |
+
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 94 |
+
|
| 95 |
+
#### Preprocessing [optional]
|
| 96 |
+
|
| 97 |
+
[More Information Needed]
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
#### Training Hyperparameters
|
| 101 |
+
|
| 102 |
+
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
| 103 |
+
|
| 104 |
+
#### Speeds, Sizes, Times [optional]
|
| 105 |
+
|
| 106 |
+
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
| 107 |
+
|
| 108 |
+
[More Information Needed]
|
| 109 |
+
|
| 110 |
+
## Evaluation
|
| 111 |
+
|
| 112 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 113 |
+
|
| 114 |
+
### Testing Data, Factors & Metrics
|
| 115 |
+
|
| 116 |
+
#### Testing Data
|
| 117 |
+
|
| 118 |
+
<!-- This should link to a Dataset Card if possible. -->
|
| 119 |
+
|
| 120 |
+
[More Information Needed]
|
| 121 |
+
|
| 122 |
+
#### Factors
|
| 123 |
+
|
| 124 |
+
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 125 |
+
|
| 126 |
+
[More Information Needed]
|
| 127 |
+
|
| 128 |
+
#### Metrics
|
| 129 |
+
|
| 130 |
+
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 131 |
+
|
| 132 |
+
[More Information Needed]
|
| 133 |
+
|
| 134 |
+
### Results
|
| 135 |
+
|
| 136 |
+
[More Information Needed]
|
| 137 |
+
|
| 138 |
+
#### Summary
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
## Model Examination [optional]
|
| 143 |
+
|
| 144 |
+
<!-- Relevant interpretability work for the model goes here -->
|
| 145 |
+
|
| 146 |
+
[More Information Needed]
|
| 147 |
+
|
| 148 |
+
## Environmental Impact
|
| 149 |
+
|
| 150 |
+
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 151 |
+
|
| 152 |
+
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 153 |
+
|
| 154 |
+
- **Hardware Type:** [More Information Needed]
|
| 155 |
+
- **Hours used:** [More Information Needed]
|
| 156 |
+
- **Cloud Provider:** [More Information Needed]
|
| 157 |
+
- **Compute Region:** [More Information Needed]
|
| 158 |
+
- **Carbon Emitted:** [More Information Needed]
|
| 159 |
+
|
| 160 |
+
## Technical Specifications [optional]
|
| 161 |
+
|
| 162 |
+
### Model Architecture and Objective
|
| 163 |
+
|
| 164 |
+
[More Information Needed]
|
| 165 |
+
|
| 166 |
+
### Compute Infrastructure
|
| 167 |
+
|
| 168 |
+
[More Information Needed]
|
| 169 |
+
|
| 170 |
+
#### Hardware
|
| 171 |
+
|
| 172 |
+
[More Information Needed]
|
| 173 |
+
|
| 174 |
+
#### Software
|
| 175 |
+
|
| 176 |
+
[More Information Needed]
|
| 177 |
+
|
| 178 |
+
## Citation [optional]
|
| 179 |
+
|
| 180 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 181 |
+
|
| 182 |
+
**BibTeX:**
|
| 183 |
+
|
| 184 |
+
[More Information Needed]
|
| 185 |
+
|
| 186 |
+
**APA:**
|
| 187 |
+
|
| 188 |
+
[More Information Needed]
|
| 189 |
+
|
| 190 |
+
## Glossary [optional]
|
| 191 |
+
|
| 192 |
+
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 193 |
+
|
| 194 |
+
[More Information Needed]
|
| 195 |
+
|
| 196 |
+
## More Information [optional]
|
| 197 |
+
|
| 198 |
+
[More Information Needed]
|
| 199 |
+
|
| 200 |
+
## Model Card Authors [optional]
|
| 201 |
+
|
| 202 |
+
[More Information Needed]
|
| 203 |
+
|
| 204 |
+
## Model Card Contact
|
| 205 |
+
|
| 206 |
+
[More Information Needed]
|
| 207 |
+
### Framework versions
|
| 208 |
+
|
| 209 |
+
- PEFT 0.19.1
|
adapter_config.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"alora_invocation_tokens": null,
|
| 3 |
+
"alpha_pattern": {},
|
| 4 |
+
"arrow_config": null,
|
| 5 |
+
"auto_mapping": null,
|
| 6 |
+
"base_model_name_or_path": "Qwen/Qwen3-14B",
|
| 7 |
+
"bias": "none",
|
| 8 |
+
"corda_config": null,
|
| 9 |
+
"ensure_weight_tying": false,
|
| 10 |
+
"eva_config": null,
|
| 11 |
+
"exclude_modules": null,
|
| 12 |
+
"fan_in_fan_out": false,
|
| 13 |
+
"inference_mode": true,
|
| 14 |
+
"init_lora_weights": true,
|
| 15 |
+
"layer_replication": null,
|
| 16 |
+
"layers_pattern": null,
|
| 17 |
+
"layers_to_transform": null,
|
| 18 |
+
"loftq_config": {},
|
| 19 |
+
"lora_alpha": 32,
|
| 20 |
+
"lora_bias": false,
|
| 21 |
+
"lora_dropout": 0.05,
|
| 22 |
+
"lora_ga_config": null,
|
| 23 |
+
"megatron_config": null,
|
| 24 |
+
"megatron_core": "megatron.core",
|
| 25 |
+
"modules_to_save": null,
|
| 26 |
+
"peft_type": "LORA",
|
| 27 |
+
"peft_version": "0.19.1",
|
| 28 |
+
"qalora_group_size": 16,
|
| 29 |
+
"r": 16,
|
| 30 |
+
"rank_pattern": {},
|
| 31 |
+
"revision": null,
|
| 32 |
+
"target_modules": [
|
| 33 |
+
"q_proj",
|
| 34 |
+
"o_proj",
|
| 35 |
+
"v_proj",
|
| 36 |
+
"k_proj"
|
| 37 |
+
],
|
| 38 |
+
"target_parameters": null,
|
| 39 |
+
"task_type": "CAUSAL_LM",
|
| 40 |
+
"trainable_token_indices": null,
|
| 41 |
+
"use_bdlora": null,
|
| 42 |
+
"use_dora": false,
|
| 43 |
+
"use_qalora": false,
|
| 44 |
+
"use_rslora": false
|
| 45 |
+
}
|
adapter_model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ace1712494e62f0b9f63bffaae0324193ba7836090a1c8460c600ba11ae82c9
|
| 3 |
+
size 83929160
|
chat_template.jinja
CHANGED
|
@@ -1,48 +1,80 @@
|
|
| 1 |
{%- if tools %}
|
| 2 |
{{- '<|im_start|>system\n' }}
|
| 3 |
-
{%- if messages[0]
|
| 4 |
-
{{- messages[0]
|
| 5 |
-
{%- else %}
|
| 6 |
-
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
|
| 7 |
{%- endif %}
|
| 8 |
-
{{- "
|
| 9 |
{%- for tool in tools %}
|
| 10 |
{{- "\n" }}
|
| 11 |
{{- tool | tojson }}
|
| 12 |
{%- endfor %}
|
| 13 |
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 14 |
{%- else %}
|
| 15 |
-
{%- if messages[0]
|
| 16 |
-
{{- '<|im_start|>system\n' + messages[0]
|
| 17 |
-
{%- else %}
|
| 18 |
-
{{- '<|im_start|>system\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\n' }}
|
| 19 |
{%- endif %}
|
| 20 |
{%- endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
{%- for message in messages %}
|
| 22 |
-
{%- if
|
| 23 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
{%- elif message.role == "assistant" %}
|
| 25 |
-
{
|
| 26 |
-
{%- if message.
|
| 27 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
{%- endif %}
|
| 29 |
-
{%-
|
| 30 |
-
{%- if
|
| 31 |
-
{
|
|
|
|
|
|
|
| 32 |
{%- endif %}
|
| 33 |
-
|
| 34 |
-
{{-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
{
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
{{- '<|im_end|>\n' }}
|
| 40 |
{%- elif message.role == "tool" %}
|
| 41 |
-
{%- if
|
| 42 |
{{- '<|im_start|>user' }}
|
| 43 |
{%- endif %}
|
| 44 |
{{- '\n<tool_response>\n' }}
|
| 45 |
-
{{-
|
| 46 |
{{- '\n</tool_response>' }}
|
| 47 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
{{- '<|im_end|>\n' }}
|
|
@@ -51,4 +83,7 @@
|
|
| 51 |
{%- endfor %}
|
| 52 |
{%- if add_generation_prompt %}
|
| 53 |
{{- '<|im_start|>assistant\n' }}
|
| 54 |
-
{%-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{%- if tools %}
|
| 2 |
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
|
|
|
|
|
|
| 5 |
{%- endif %}
|
| 6 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 7 |
{%- for tool in tools %}
|
| 8 |
{{- "\n" }}
|
| 9 |
{{- tool | tojson }}
|
| 10 |
{%- endfor %}
|
| 11 |
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
|
|
|
|
|
|
| 15 |
{%- endif %}
|
| 16 |
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
{%- for message in messages %}
|
| 26 |
+
{%- if message.content is string %}
|
| 27 |
+
{%- set content = message.content %}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{%- set content = '' %}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 32 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 33 |
{%- elif message.role == "assistant" %}
|
| 34 |
+
{%- set reasoning_content = '' %}
|
| 35 |
+
{%- if message.reasoning_content is string %}
|
| 36 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 37 |
+
{%- else %}
|
| 38 |
+
{%- if '</think>' in content %}
|
| 39 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 40 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 41 |
+
{%- endif %}
|
| 42 |
{%- endif %}
|
| 43 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 44 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 45 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 46 |
+
{%- else %}
|
| 47 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 48 |
{%- endif %}
|
| 49 |
+
{%- else %}
|
| 50 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 51 |
+
{%- endif %}
|
| 52 |
+
{%- if message.tool_calls %}
|
| 53 |
+
{%- for tool_call in message.tool_calls %}
|
| 54 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 55 |
+
{{- '\n' }}
|
| 56 |
+
{%- endif %}
|
| 57 |
+
{%- if tool_call.function %}
|
| 58 |
+
{%- set tool_call = tool_call.function %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 61 |
+
{{- tool_call.name }}
|
| 62 |
+
{{- '", "arguments": ' }}
|
| 63 |
+
{%- if tool_call.arguments is string %}
|
| 64 |
+
{{- tool_call.arguments }}
|
| 65 |
+
{%- else %}
|
| 66 |
+
{{- tool_call.arguments | tojson }}
|
| 67 |
+
{%- endif %}
|
| 68 |
+
{{- '}\n</tool_call>' }}
|
| 69 |
+
{%- endfor %}
|
| 70 |
+
{%- endif %}
|
| 71 |
{{- '<|im_end|>\n' }}
|
| 72 |
{%- elif message.role == "tool" %}
|
| 73 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 74 |
{{- '<|im_start|>user' }}
|
| 75 |
{%- endif %}
|
| 76 |
{{- '\n<tool_response>\n' }}
|
| 77 |
+
{{- content }}
|
| 78 |
{{- '\n</tool_response>' }}
|
| 79 |
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 80 |
{{- '<|im_end|>\n' }}
|
|
|
|
| 83 |
{%- endfor %}
|
| 84 |
{%- if add_generation_prompt %}
|
| 85 |
{{- '<|im_start|>assistant\n' }}
|
| 86 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 87 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 88 |
+
{%- endif %}
|
| 89 |
+
{%- endif %}
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be75606093db2094d7cd20f3c2f385c212750648bd6ea4fb2bf507a6a4c55506
|
| 3 |
+
size 11422650
|
tokenizer_config.json
CHANGED
|
@@ -21,8 +21,9 @@
|
|
| 21 |
"<|video_pad|>"
|
| 22 |
],
|
| 23 |
"is_local": false,
|
| 24 |
-
"
|
| 25 |
-
"
|
|
|
|
| 26 |
"split_special_tokens": false,
|
| 27 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 28 |
"unk_token": null
|
|
|
|
| 21 |
"<|video_pad|>"
|
| 22 |
],
|
| 23 |
"is_local": false,
|
| 24 |
+
"local_files_only": false,
|
| 25 |
+
"model_max_length": 131072,
|
| 26 |
+
"pad_token": "<|im_end|>",
|
| 27 |
"split_special_tokens": false,
|
| 28 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
"unk_token": null
|