Text Generation
Transformers
Safetensors
qwen3
multiple-choice
general-knowledge
lora
sft
boxed-answer
conversational
text-generation-inference
Instructions to use cs-552-2026-databand/general_knowledge_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cs-552-2026-databand/general_knowledge_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cs-552-2026-databand/general_knowledge_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cs-552-2026-databand/general_knowledge_model") model = AutoModelForCausalLM.from_pretrained("cs-552-2026-databand/general_knowledge_model") 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 cs-552-2026-databand/general_knowledge_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cs-552-2026-databand/general_knowledge_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cs-552-2026-databand/general_knowledge_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cs-552-2026-databand/general_knowledge_model
- SGLang
How to use cs-552-2026-databand/general_knowledge_model 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 "cs-552-2026-databand/general_knowledge_model" \ --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": "cs-552-2026-databand/general_knowledge_model", "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 "cs-552-2026-databand/general_knowledge_model" \ --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": "cs-552-2026-databand/general_knowledge_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cs-552-2026-databand/general_knowledge_model with Docker Model Runner:
docker model run hf.co/cs-552-2026-databand/general_knowledge_model
Upload full SFT v1 general knowledge model
Browse files- chat_template.jinja +28 -91
- config.json +2 -2
- generation_config.json +2 -2
- model.safetensors +2 -2
- tokenizer_config.json +1 -1
- training_args.bin +3 -0
chat_template.jinja
CHANGED
|
@@ -1,94 +1,31 @@
|
|
| 1 |
-
{# Forces enable_thinking = true regardless of CI runtime kwargs.
|
| 2 |
-
Prepended to the official Qwen/Qwen3-1.7B chat_template.jinja by
|
| 3 |
-
scripts/push_baseline.py at deploy time. Applied to: math, group. #}
|
| 4 |
{%- set enable_thinking = false -%}
|
| 5 |
-
{%- set
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
{%-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
{
|
| 12 |
-
{%-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
{%-
|
| 18 |
-
{%- if
|
| 19 |
-
{{- '<|im_start|>
|
| 20 |
-
{%-
|
| 21 |
-
{
|
| 22 |
-
{%-
|
| 23 |
-
{
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
{%-
|
| 30 |
-
{%- for message in messages %}
|
| 31 |
-
{%- if message.content is string %}
|
| 32 |
-
{%- set content = message.content %}
|
| 33 |
-
{%- else %}
|
| 34 |
-
{%- set content = '' %}
|
| 35 |
-
{%- endif %}
|
| 36 |
-
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 37 |
-
{{- '<|im_start|>' + message.role + ' ' + system_message + '\n' + content + '<|im_end|>' + '\n' }}
|
| 38 |
-
{%- elif message.role == "assistant" %}
|
| 39 |
-
{%- set reasoning_content = '' %}
|
| 40 |
-
{%- if message.reasoning_content is string %}
|
| 41 |
-
{%- set reasoning_content = message.reasoning_content %}
|
| 42 |
-
{%- else %}
|
| 43 |
-
{%- if '</think>' in content %}
|
| 44 |
-
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 45 |
-
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 46 |
-
{%- endif %}
|
| 47 |
-
{%- endif %}
|
| 48 |
-
{%- if loop.index0 > ns.last_query_index %}
|
| 49 |
-
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 50 |
-
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 51 |
-
{%- else %}
|
| 52 |
-
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 53 |
-
{%- endif %}
|
| 54 |
-
{%- else %}
|
| 55 |
-
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 56 |
-
{%- endif %}
|
| 57 |
-
{%- if message.tool_calls %}
|
| 58 |
-
{%- for tool_call in message.tool_calls %}
|
| 59 |
-
{%- if (loop.first and content) or (not loop.first) %}
|
| 60 |
-
{{- '\n' }}
|
| 61 |
-
{%- endif %}
|
| 62 |
-
{%- if tool_call.function %}
|
| 63 |
-
{%- set tool_call = tool_call.function %}
|
| 64 |
-
{%- endif %}
|
| 65 |
-
{{- '<tool_call>\n{"name": "' }}
|
| 66 |
-
{{- tool_call.name }}
|
| 67 |
-
{{- '", "arguments": ' }}
|
| 68 |
-
{%- if tool_call.arguments is string %}
|
| 69 |
-
{{- tool_call.arguments }}
|
| 70 |
-
{%- else %}
|
| 71 |
-
{{- tool_call.arguments | tojson }}
|
| 72 |
-
{%- endif %}
|
| 73 |
-
{{- '}\n</tool_call>' }}
|
| 74 |
-
{%- endfor %}
|
| 75 |
-
{%- endif %}
|
| 76 |
-
{{- '<|im_end|>\n' }}
|
| 77 |
-
{%- elif message.role == "tool" %}
|
| 78 |
-
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 79 |
-
{{- '<|im_start|>user' }}
|
| 80 |
-
{%- endif %}
|
| 81 |
-
{{- '\n<tool_response>\n' }}
|
| 82 |
-
{{- content }}
|
| 83 |
-
{{- '\n</tool_response>' }}
|
| 84 |
-
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 85 |
-
{{- '<|im_end|>\n' }}
|
| 86 |
-
{%- endif %}
|
| 87 |
-
{%- endif %}
|
| 88 |
-
{%- endfor %}
|
| 89 |
-
{%- if add_generation_prompt %}
|
| 90 |
{{- '<|im_start|>assistant\n' }}
|
| 91 |
-
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 92 |
{{- '<think>\n\n</think>\n\n' }}
|
| 93 |
-
{%- endif %}
|
| 94 |
-
{%- endif %}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
{%- set enable_thinking = false -%}
|
| 2 |
+
{%- set default_system_message = "You are a multiple-choice general knowledge answerer.\n\nThe user will provide a question and a list of choices. Choose exactly one option.\n\nThe choices may have any number of labels, for example A, B, C, D, ... up to T. Your answer must be the letter of the best choice.\n\nYour entire response must be exactly one boxed answer, such as \\boxed{A}, \\boxed{C}, \\boxed{J}, or \\boxed{T}.\n\nDo not explain. Do not show reasoning. Do not write words. Do not add punctuation. Do not write anything before or after the boxed answer." -%}
|
| 3 |
+
|
| 4 |
+
{%- if messages and messages[0]['role'] == 'system' -%}
|
| 5 |
+
{%- set system_message = default_system_message + '\n\n' + messages[0]['content'] -%}
|
| 6 |
+
{%- set loop_messages = messages[1:] -%}
|
| 7 |
+
{%- else -%}
|
| 8 |
+
{%- set system_message = default_system_message -%}
|
| 9 |
+
{%- set loop_messages = messages -%}
|
| 10 |
+
{%- endif -%}
|
| 11 |
+
|
| 12 |
+
{{- '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}
|
| 13 |
+
|
| 14 |
+
{%- for message in loop_messages -%}
|
| 15 |
+
{%- if message['role'] == 'user' -%}
|
| 16 |
+
{{- '<|im_start|>user\n' + message['content'] + '<|im_end|>\n' }}
|
| 17 |
+
{%- elif message['role'] == 'assistant' -%}
|
| 18 |
+
{{- '<|im_start|>assistant\n' }}
|
| 19 |
+
{%- if enable_thinking is defined and enable_thinking is false -%}
|
| 20 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 21 |
+
{%- endif -%}
|
| 22 |
+
{{- message['content'] + '<|im_end|>\n' }}
|
| 23 |
+
{%- endif -%}
|
| 24 |
+
{%- endfor -%}
|
| 25 |
+
|
| 26 |
+
{%- if add_generation_prompt -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
{{- '<|im_start|>assistant\n' }}
|
| 28 |
+
{%- if enable_thinking is defined and enable_thinking is false -%}
|
| 29 |
{{- '<think>\n\n</think>\n\n' }}
|
| 30 |
+
{%- endif -%}
|
| 31 |
+
{%- endif -%}
|
config.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 151643,
|
| 8 |
-
"dtype": "
|
| 9 |
"eos_token_id": 151645,
|
| 10 |
"head_dim": 128,
|
| 11 |
"hidden_act": "silu",
|
|
@@ -57,7 +57,7 @@
|
|
| 57 |
"sliding_window": null,
|
| 58 |
"tie_word_embeddings": true,
|
| 59 |
"transformers_version": "5.7.0",
|
| 60 |
-
"use_cache":
|
| 61 |
"use_sliding_window": false,
|
| 62 |
"vocab_size": 151936
|
| 63 |
}
|
|
|
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
"bos_token_id": 151643,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
"eos_token_id": 151645,
|
| 10 |
"head_dim": 128,
|
| 11 |
"hidden_act": "silu",
|
|
|
|
| 57 |
"sliding_window": null,
|
| 58 |
"tie_word_embeddings": true,
|
| 59 |
"transformers_version": "5.7.0",
|
| 60 |
+
"use_cache": false,
|
| 61 |
"use_sliding_window": false,
|
| 62 |
"vocab_size": 151936
|
| 63 |
}
|
generation_config.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
| 6 |
151643
|
| 7 |
],
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
-
"temperature": 0.
|
| 10 |
"top_k": 20,
|
| 11 |
-
"top_p": 0.
|
| 12 |
"transformers_version": "5.7.0"
|
| 13 |
}
|
|
|
|
| 6 |
151643
|
| 7 |
],
|
| 8 |
"pad_token_id": 151643,
|
| 9 |
+
"temperature": 0.1,
|
| 10 |
"top_k": 20,
|
| 11 |
+
"top_p": 0.8,
|
| 12 |
"transformers_version": "5.7.0"
|
| 13 |
}
|
model.safetensors
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:1ed2ae875a376a7d4a0e8f2ec4a40452b2070dfedc50dd2e0e340f1ed09a6989
|
| 3 |
+
size 3441185608
|
tokenizer_config.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
| 20 |
"<|image_pad|>",
|
| 21 |
"<|video_pad|>"
|
| 22 |
],
|
| 23 |
-
"is_local":
|
| 24 |
"local_files_only": false,
|
| 25 |
"model_max_length": 131072,
|
| 26 |
"pad_token": "<|endoftext|>",
|
|
|
|
| 20 |
"<|image_pad|>",
|
| 21 |
"<|video_pad|>"
|
| 22 |
],
|
| 23 |
+
"is_local": true,
|
| 24 |
"local_files_only": false,
|
| 25 |
"model_max_length": 131072,
|
| 26 |
"pad_token": "<|endoftext|>",
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c7fef7c910e9ebfd35ba5767e2a099909c6387cbe09a804c4e3f8cb7d3f496c
|
| 3 |
+
size 5265
|