Text Generation
Transformers
Safetensors
GGUF
English
qwen2
1.5b
commands
devops
fableforge
imatrix
llama.cpp
lm-studio
ollama
shell
sysadmin
terminal
uncensored
conversational
text-generation-inference
Instructions to use fableforge-ai/ShellWhisperer-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fableforge-ai/ShellWhisperer-1.5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fableforge-ai/ShellWhisperer-1.5B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fableforge-ai/ShellWhisperer-1.5B") model = AutoModelForCausalLM.from_pretrained("fableforge-ai/ShellWhisperer-1.5B", device_map="auto") 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
- llama.cpp
How to use fableforge-ai/ShellWhisperer-1.5B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M # Run inference directly in the terminal: llama cli -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M # Run inference directly in the terminal: llama cli -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
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 fableforge-ai/ShellWhisperer-1.5B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
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 fableforge-ai/ShellWhisperer-1.5B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
Use Docker
docker model run hf.co/fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use fableforge-ai/ShellWhisperer-1.5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fableforge-ai/ShellWhisperer-1.5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fableforge-ai/ShellWhisperer-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
- SGLang
How to use fableforge-ai/ShellWhisperer-1.5B 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 "fableforge-ai/ShellWhisperer-1.5B" \ --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": "fableforge-ai/ShellWhisperer-1.5B", "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 "fableforge-ai/ShellWhisperer-1.5B" \ --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": "fableforge-ai/ShellWhisperer-1.5B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use fableforge-ai/ShellWhisperer-1.5B with Ollama:
ollama run hf.co/fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
- Unsloth Studio
How to use fableforge-ai/ShellWhisperer-1.5B 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 fableforge-ai/ShellWhisperer-1.5B 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 fableforge-ai/ShellWhisperer-1.5B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for fableforge-ai/ShellWhisperer-1.5B to start chatting
- Pi
How to use fableforge-ai/ShellWhisperer-1.5B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
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": "fableforge-ai/ShellWhisperer-1.5B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use fableforge-ai/ShellWhisperer-1.5B with Docker Model Runner:
docker model run hf.co/fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
- Lemonade
How to use fableforge-ai/ShellWhisperer-1.5B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
Run and chat with the model
lemonade run user.ShellWhisperer-1.5B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use fableforge-ai/ShellWhisperer-1.5B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
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 fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use fableforge-ai/ShellWhisperer-1.5B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf fableforge-ai/ShellWhisperer-1.5B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "fableforge-ai/ShellWhisperer-1.5B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload ShellWhisperer-1.5B fine-tuned with Unsloth QLoRA
Browse files- .gitattributes +1 -0
- chat_template.jinja +54 -0
- config.json +60 -19
- generation_config.json +11 -7
- model.safetensors +3 -0
- tokenizer.json +3 -65
- tokenizer_config.json +199 -33
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 4 |
+
{{- messages[0]['content'] }}
|
| 5 |
+
{%- else %}
|
| 6 |
+
{{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}
|
| 7 |
+
{%- endif %}
|
| 8 |
+
{{- "\n\n# 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>" }}
|
| 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]['role'] == 'system' %}
|
| 16 |
+
{{- '<|im_start|>system\n' + messages[0]['content'] + '<|im_end|>\n' }}
|
| 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 (message.role == "user") or (message.role == "system" and not loop.first) or (message.role == "assistant" and not message.tool_calls) %}
|
| 23 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 24 |
+
{%- elif message.role == "assistant" %}
|
| 25 |
+
{{- '<|im_start|>' + message.role }}
|
| 26 |
+
{%- if message.content %}
|
| 27 |
+
{{- '\n' + message.content }}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- for tool_call in message.tool_calls %}
|
| 30 |
+
{%- if tool_call.function is defined %}
|
| 31 |
+
{%- set tool_call = tool_call.function %}
|
| 32 |
+
{%- endif %}
|
| 33 |
+
{{- '\n<tool_call>\n{"name": "' }}
|
| 34 |
+
{{- tool_call.name }}
|
| 35 |
+
{{- '", "arguments": ' }}
|
| 36 |
+
{{- tool_call.arguments | tojson }}
|
| 37 |
+
{{- '}\n</tool_call>' }}
|
| 38 |
+
{%- endfor %}
|
| 39 |
+
{{- '<|im_end|>\n' }}
|
| 40 |
+
{%- elif message.role == "tool" %}
|
| 41 |
+
{%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != "tool") %}
|
| 42 |
+
{{- '<|im_start|>user' }}
|
| 43 |
+
{%- endif %}
|
| 44 |
+
{{- '\n<tool_response>\n' }}
|
| 45 |
+
{{- message.content }}
|
| 46 |
+
{{- '\n</tool_response>' }}
|
| 47 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 48 |
+
{{- '<|im_end|>\n' }}
|
| 49 |
+
{%- endif %}
|
| 50 |
+
{%- endif %}
|
| 51 |
+
{%- endfor %}
|
| 52 |
+
{%- if add_generation_prompt %}
|
| 53 |
+
{{- '<|im_start|>assistant\n' }}
|
| 54 |
+
{%- endif %}
|
config.json
CHANGED
|
@@ -1,21 +1,62 @@
|
|
| 1 |
{
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": null,
|
| 7 |
+
"torch_dtype": "float16",
|
| 8 |
+
"eos_token_id": 151645,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 1536,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 8960,
|
| 13 |
+
"layer_types": [
|
| 14 |
+
"full_attention",
|
| 15 |
+
"full_attention",
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention"
|
| 42 |
+
],
|
| 43 |
+
"max_position_embeddings": 32768,
|
| 44 |
+
"max_window_layers": 21,
|
| 45 |
+
"model_type": "qwen2",
|
| 46 |
+
"num_attention_heads": 12,
|
| 47 |
+
"num_hidden_layers": 28,
|
| 48 |
+
"num_key_value_heads": 2,
|
| 49 |
+
"pad_token_id": 151665,
|
| 50 |
+
"rms_norm_eps": 1e-06,
|
| 51 |
+
"rope_parameters": {
|
| 52 |
+
"rope_theta": 1000000.0,
|
| 53 |
+
"rope_type": "default"
|
| 54 |
+
},
|
| 55 |
+
"sliding_window": null,
|
| 56 |
+
"tie_word_embeddings": true,
|
| 57 |
+
"unsloth_fixed": true,
|
| 58 |
+
"unsloth_version": "2026.6.7",
|
| 59 |
+
"use_cache": false,
|
| 60 |
+
"use_sliding_window": false,
|
| 61 |
+
"vocab_size": 151936
|
| 62 |
}
|
generation_config.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
{
|
| 2 |
-
"bos_token_id": 1,
|
| 3 |
-
"eos_token_id": 2,
|
| 4 |
"do_sample": true,
|
| 5 |
-
"
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 8 |
"repetition_penalty": 1.1,
|
| 9 |
-
"
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
| 2 |
"do_sample": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
151645,
|
| 5 |
+
151643
|
| 6 |
+
],
|
| 7 |
+
"max_length": 32768,
|
| 8 |
+
"pad_token_id": 151665,
|
| 9 |
"repetition_penalty": 1.1,
|
| 10 |
+
"temperature": 0.7,
|
| 11 |
+
"top_k": 20,
|
| 12 |
+
"top_p": 0.8,
|
| 13 |
+
"transformers_version": "5.5.0"
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:730af213553ff0766ee13488fa19e9f239008ea047601074eb3156f2b1ac3121
|
| 3 |
+
size 3087467144
|
tokenizer.json
CHANGED
|
@@ -1,65 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
"padding": null,
|
| 5 |
-
"added_tokens": [
|
| 6 |
-
{
|
| 7 |
-
"id": 0,
|
| 8 |
-
"content": "<unk>",
|
| 9 |
-
"single_word": false,
|
| 10 |
-
"lstrip": false,
|
| 11 |
-
"rstrip": false,
|
| 12 |
-
"normalized": false,
|
| 13 |
-
"special": true
|
| 14 |
-
},
|
| 15 |
-
{
|
| 16 |
-
"id": 1,
|
| 17 |
-
"content": "<s>",
|
| 18 |
-
"single_word": false,
|
| 19 |
-
"lstrip": false,
|
| 20 |
-
"rstrip": false,
|
| 21 |
-
"normalized": false,
|
| 22 |
-
"special": true
|
| 23 |
-
},
|
| 24 |
-
{
|
| 25 |
-
"id": 2,
|
| 26 |
-
"content": "</s>",
|
| 27 |
-
"single_word": false,
|
| 28 |
-
"lstrip": false,
|
| 29 |
-
"rstrip": false,
|
| 30 |
-
"normalized": false,
|
| 31 |
-
"special": true
|
| 32 |
-
}
|
| 33 |
-
],
|
| 34 |
-
"normalizer": null,
|
| 35 |
-
"pre_tokenizer": {
|
| 36 |
-
"type": "ByteLevel",
|
| 37 |
-
"add_prefix_space": false,
|
| 38 |
-
"trim_offsets": true,
|
| 39 |
-
"use_regex": true
|
| 40 |
-
},
|
| 41 |
-
"post_processor": {
|
| 42 |
-
"type": "ByteLevel",
|
| 43 |
-
"add_prefix_space": true,
|
| 44 |
-
"trim_offsets": false,
|
| 45 |
-
"use_regex": true
|
| 46 |
-
},
|
| 47 |
-
"decoder": {
|
| 48 |
-
"type": "ByteLevel"
|
| 49 |
-
},
|
| 50 |
-
"model": {
|
| 51 |
-
"type": "BPE",
|
| 52 |
-
"dropout": null,
|
| 53 |
-
"unk_token": "<unk>",
|
| 54 |
-
"continuing_subword_prefix": null,
|
| 55 |
-
"end_of_word_suffix": null,
|
| 56 |
-
"fuse_unk": false,
|
| 57 |
-
"byte_fallback": false,
|
| 58 |
-
"vocab": {
|
| 59 |
-
"<unk>": 0,
|
| 60 |
-
"<s>": 1,
|
| 61 |
-
"</s>": 2
|
| 62 |
-
},
|
| 63 |
-
"merges": []
|
| 64 |
-
}
|
| 65 |
-
}
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:437cd47f197286ffa5b57e807b77a16970a0fb8befe1be29c56d65d0cd34379e
|
| 3 |
+
size 11422181
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tokenizer_config.json
CHANGED
|
@@ -1,37 +1,203 @@
|
|
| 1 |
{
|
| 2 |
-
"add_bos_token": true,
|
| 3 |
-
"add_eos_token": false,
|
| 4 |
"add_prefix_space": false,
|
| 5 |
-
"
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
},
|
| 12 |
-
"
|
| 13 |
-
"content": "</s>",
|
| 14 |
-
"lstrip": false,
|
| 15 |
-
"normalized": false,
|
| 16 |
-
"rstrip": false,
|
| 17 |
-
"single_word": false
|
| 18 |
-
},
|
| 19 |
-
"unk_token": {
|
| 20 |
-
"content": "<unk>",
|
| 21 |
-
"lstrip": false,
|
| 22 |
-
"normalized": false,
|
| 23 |
-
"rstrip": false,
|
| 24 |
-
"single_word": false
|
| 25 |
-
},
|
| 26 |
-
"pad_token": {
|
| 27 |
-
"content": "<pad>",
|
| 28 |
-
"lstrip": false,
|
| 29 |
-
"normalized": false,
|
| 30 |
-
"rstrip": false,
|
| 31 |
-
"single_word": false
|
| 32 |
-
},
|
| 33 |
-
"model_type": "llama",
|
| 34 |
-
"model_max_length": 2048,
|
| 35 |
-
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 36 |
-
"clean_up_tokenization_spaces": false
|
| 37 |
}
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
| 2 |
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [],
|
| 9 |
+
"is_local": false,
|
| 10 |
+
"model_max_length": 32768,
|
| 11 |
+
"pad_token": "<|PAD_TOKEN|>",
|
| 12 |
+
"padding_side": "right",
|
| 13 |
+
"split_special_tokens": false,
|
| 14 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 15 |
+
"unk_token": null,
|
| 16 |
+
"added_tokens_decoder": {
|
| 17 |
+
"151643": {
|
| 18 |
+
"content": "<|endoftext|>",
|
| 19 |
+
"single_word": false,
|
| 20 |
+
"lstrip": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"special": true
|
| 24 |
+
},
|
| 25 |
+
"151644": {
|
| 26 |
+
"content": "<|im_start|>",
|
| 27 |
+
"single_word": false,
|
| 28 |
+
"lstrip": false,
|
| 29 |
+
"rstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"special": true
|
| 32 |
+
},
|
| 33 |
+
"151645": {
|
| 34 |
+
"content": "<|im_end|>",
|
| 35 |
+
"single_word": false,
|
| 36 |
+
"lstrip": false,
|
| 37 |
+
"rstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"special": true
|
| 40 |
+
},
|
| 41 |
+
"151646": {
|
| 42 |
+
"content": "<|object_ref_start|>",
|
| 43 |
+
"single_word": false,
|
| 44 |
+
"lstrip": false,
|
| 45 |
+
"rstrip": false,
|
| 46 |
+
"normalized": false,
|
| 47 |
+
"special": true
|
| 48 |
+
},
|
| 49 |
+
"151647": {
|
| 50 |
+
"content": "<|object_ref_end|>",
|
| 51 |
+
"single_word": false,
|
| 52 |
+
"lstrip": false,
|
| 53 |
+
"rstrip": false,
|
| 54 |
+
"normalized": false,
|
| 55 |
+
"special": true
|
| 56 |
+
},
|
| 57 |
+
"151648": {
|
| 58 |
+
"content": "<|box_start|>",
|
| 59 |
+
"single_word": false,
|
| 60 |
+
"lstrip": false,
|
| 61 |
+
"rstrip": false,
|
| 62 |
+
"normalized": false,
|
| 63 |
+
"special": true
|
| 64 |
+
},
|
| 65 |
+
"151649": {
|
| 66 |
+
"content": "<|box_end|>",
|
| 67 |
+
"single_word": false,
|
| 68 |
+
"lstrip": false,
|
| 69 |
+
"rstrip": false,
|
| 70 |
+
"normalized": false,
|
| 71 |
+
"special": true
|
| 72 |
+
},
|
| 73 |
+
"151650": {
|
| 74 |
+
"content": "<|quad_start|>",
|
| 75 |
+
"single_word": false,
|
| 76 |
+
"lstrip": false,
|
| 77 |
+
"rstrip": false,
|
| 78 |
+
"normalized": false,
|
| 79 |
+
"special": true
|
| 80 |
+
},
|
| 81 |
+
"151651": {
|
| 82 |
+
"content": "<|quad_end|>",
|
| 83 |
+
"single_word": false,
|
| 84 |
+
"lstrip": false,
|
| 85 |
+
"rstrip": false,
|
| 86 |
+
"normalized": false,
|
| 87 |
+
"special": true
|
| 88 |
+
},
|
| 89 |
+
"151652": {
|
| 90 |
+
"content": "<|vision_start|>",
|
| 91 |
+
"single_word": false,
|
| 92 |
+
"lstrip": false,
|
| 93 |
+
"rstrip": false,
|
| 94 |
+
"normalized": false,
|
| 95 |
+
"special": true
|
| 96 |
+
},
|
| 97 |
+
"151653": {
|
| 98 |
+
"content": "<|vision_end|>",
|
| 99 |
+
"single_word": false,
|
| 100 |
+
"lstrip": false,
|
| 101 |
+
"rstrip": false,
|
| 102 |
+
"normalized": false,
|
| 103 |
+
"special": true
|
| 104 |
+
},
|
| 105 |
+
"151654": {
|
| 106 |
+
"content": "<|vision_pad|>",
|
| 107 |
+
"single_word": false,
|
| 108 |
+
"lstrip": false,
|
| 109 |
+
"rstrip": false,
|
| 110 |
+
"normalized": false,
|
| 111 |
+
"special": true
|
| 112 |
+
},
|
| 113 |
+
"151655": {
|
| 114 |
+
"content": "<|image_pad|>",
|
| 115 |
+
"single_word": false,
|
| 116 |
+
"lstrip": false,
|
| 117 |
+
"rstrip": false,
|
| 118 |
+
"normalized": false,
|
| 119 |
+
"special": true
|
| 120 |
+
},
|
| 121 |
+
"151656": {
|
| 122 |
+
"content": "<|video_pad|>",
|
| 123 |
+
"single_word": false,
|
| 124 |
+
"lstrip": false,
|
| 125 |
+
"rstrip": false,
|
| 126 |
+
"normalized": false,
|
| 127 |
+
"special": true
|
| 128 |
+
},
|
| 129 |
+
"151657": {
|
| 130 |
+
"content": "<tool_call>",
|
| 131 |
+
"single_word": false,
|
| 132 |
+
"lstrip": false,
|
| 133 |
+
"rstrip": false,
|
| 134 |
+
"normalized": false,
|
| 135 |
+
"special": false
|
| 136 |
+
},
|
| 137 |
+
"151658": {
|
| 138 |
+
"content": "</tool_call>",
|
| 139 |
+
"single_word": false,
|
| 140 |
+
"lstrip": false,
|
| 141 |
+
"rstrip": false,
|
| 142 |
+
"normalized": false,
|
| 143 |
+
"special": false
|
| 144 |
+
},
|
| 145 |
+
"151659": {
|
| 146 |
+
"content": "<|fim_prefix|>",
|
| 147 |
+
"single_word": false,
|
| 148 |
+
"lstrip": false,
|
| 149 |
+
"rstrip": false,
|
| 150 |
+
"normalized": false,
|
| 151 |
+
"special": false
|
| 152 |
+
},
|
| 153 |
+
"151660": {
|
| 154 |
+
"content": "<|fim_middle|>",
|
| 155 |
+
"single_word": false,
|
| 156 |
+
"lstrip": false,
|
| 157 |
+
"rstrip": false,
|
| 158 |
+
"normalized": false,
|
| 159 |
+
"special": false
|
| 160 |
+
},
|
| 161 |
+
"151661": {
|
| 162 |
+
"content": "<|fim_suffix|>",
|
| 163 |
+
"single_word": false,
|
| 164 |
+
"lstrip": false,
|
| 165 |
+
"rstrip": false,
|
| 166 |
+
"normalized": false,
|
| 167 |
+
"special": false
|
| 168 |
+
},
|
| 169 |
+
"151662": {
|
| 170 |
+
"content": "<|fim_pad|>",
|
| 171 |
+
"single_word": false,
|
| 172 |
+
"lstrip": false,
|
| 173 |
+
"rstrip": false,
|
| 174 |
+
"normalized": false,
|
| 175 |
+
"special": false
|
| 176 |
+
},
|
| 177 |
+
"151663": {
|
| 178 |
+
"content": "<|repo_name|>",
|
| 179 |
+
"single_word": false,
|
| 180 |
+
"lstrip": false,
|
| 181 |
+
"rstrip": false,
|
| 182 |
+
"normalized": false,
|
| 183 |
+
"special": false
|
| 184 |
+
},
|
| 185 |
+
"151664": {
|
| 186 |
+
"content": "<|file_sep|>",
|
| 187 |
+
"single_word": false,
|
| 188 |
+
"lstrip": false,
|
| 189 |
+
"rstrip": false,
|
| 190 |
+
"normalized": false,
|
| 191 |
+
"special": false
|
| 192 |
+
},
|
| 193 |
+
"151665": {
|
| 194 |
+
"content": "<|PAD_TOKEN|>",
|
| 195 |
+
"single_word": false,
|
| 196 |
+
"lstrip": false,
|
| 197 |
+
"rstrip": false,
|
| 198 |
+
"normalized": false,
|
| 199 |
+
"special": true
|
| 200 |
+
}
|
| 201 |
},
|
| 202 |
+
"chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0]['role'] == 'system' %}\n {{- messages[0]['content'] }}\n {%- else %}\n {{- 'You are Qwen, created by Alibaba Cloud. You are a helpful assistant.' }}\n {%- endif %}\n {{- \"\\n\\n# 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>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\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\" }}\n{%- else %}\n {%- if messages[0]['role'] == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}\n {%- else %}\n {{- '<|im_start|>system\\nYou are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) or (message.role == \"assistant\" and not message.tool_calls) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {{- '<|im_start|>' + message.role }}\n {%- if message.content %}\n {{- '\\n' + message.content }}\n {%- endif %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '\\n<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if (loop.index0 == 0) or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n{%- endif %}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
}
|