Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
qwen3.5
reasoning
long-context
1M-context
function-calling
tool-use
sft
full-fine-tune
agentic
conversational
multimodal
vision
Eval Results (legacy)
Instructions to use TaimoorSiddiqui/Hopcoder-Mini-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TaimoorSiddiqui/Hopcoder-Mini-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TaimoorSiddiqui/Hopcoder-Mini-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("TaimoorSiddiqui/Hopcoder-Mini-9B") model = AutoModelForMultimodalLM.from_pretrained("TaimoorSiddiqui/Hopcoder-Mini-9B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TaimoorSiddiqui/Hopcoder-Mini-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TaimoorSiddiqui/Hopcoder-Mini-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TaimoorSiddiqui/Hopcoder-Mini-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TaimoorSiddiqui/Hopcoder-Mini-9B
- SGLang
How to use TaimoorSiddiqui/Hopcoder-Mini-9B 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 "TaimoorSiddiqui/Hopcoder-Mini-9B" \ --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": "TaimoorSiddiqui/Hopcoder-Mini-9B", "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 "TaimoorSiddiqui/Hopcoder-Mini-9B" \ --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": "TaimoorSiddiqui/Hopcoder-Mini-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TaimoorSiddiqui/Hopcoder-Mini-9B with Docker Model Runner:
docker model run hf.co/TaimoorSiddiqui/Hopcoder-Mini-9B
Commit ·
5173e4c
1
Parent(s): 15a3575
Fix config bugs, add disable_identity toggle, rename assets to hopcoder
Browse files- .gitattributes +1 -1
- README.md +55 -5
- assets/{qwythos.png → hopcoder.png} +0 -0
- assets/{qwythos_eval_chart.svg → hopcoder_eval_chart.svg} +5 -5
- chat_template.jinja +8 -0
- config.json +2 -2
- evals/lm_eval_results.md +2 -2
- generation_config.json +1 -4
- preprocessor_config.json +2 -2
- tokenizer_config.json +1 -1
- video_preprocessor_config.json +2 -2
.gitattributes
CHANGED
|
@@ -33,5 +33,5 @@ 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
|
| 36 |
-
assets/
|
| 37 |
tokenizer.json 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 |
+
assets/hopcoder.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
-
base_model:
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
library_name: transformers
|
|
@@ -27,7 +27,7 @@ tags:
|
|
| 27 |
- **1M-token context** out of the box via YaRN.
|
| 28 |
- **Native Qwen3.5-style function calling** — no wrapper needed.
|
| 29 |
- **Self-corrects with tools** — emits source-cited, factually grounded answers when given a Python executor and web search.
|
| 30 |
-
- Built on a Qwen3.5-9B base, full-parameter fine-tuned on high-quality reasoning traces.
|
| 31 |
|
| 32 |
## Architecture
|
| 33 |
|
|
@@ -44,17 +44,67 @@ tags:
|
|
| 44 |
| Max context | 1,048,576 tokens |
|
| 45 |
| Precision | bfloat16 |
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
## Usage
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
```python
|
| 50 |
-
from transformers import
|
|
|
|
| 51 |
|
| 52 |
-
model =
|
| 53 |
"TaimoorSiddiqui/Hopcoder-Mini-9B",
|
| 54 |
torch_dtype="bfloat16",
|
| 55 |
device_map="auto",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
)
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
```
|
| 59 |
|
| 60 |
Sampling: `temperature=0.6, top_p=0.95, top_k=20` (Qwen3.5 defaults).
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model: empero-ai/Qwythos-9B-Claude-Mythos-5-1M
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
library_name: transformers
|
|
|
|
| 27 |
- **1M-token context** out of the box via YaRN.
|
| 28 |
- **Native Qwen3.5-style function calling** — no wrapper needed.
|
| 29 |
- **Self-corrects with tools** — emits source-cited, factually grounded answers when given a Python executor and web search.
|
| 30 |
+
- Built on a Qwen3.5-9B base (via empero-ai/Qwythos-9B-Claude-Mythos-5-1M), full-parameter fine-tuned on high-quality reasoning traces.
|
| 31 |
|
| 32 |
## Architecture
|
| 33 |
|
|
|
|
| 44 |
| Max context | 1,048,576 tokens |
|
| 45 |
| Precision | bfloat16 |
|
| 46 |
|
| 47 |
+
## Requirements
|
| 48 |
+
|
| 49 |
+
- `transformers >= 5.12.1` (required for `qwen3_5` model type)
|
| 50 |
+
- `torch >= 2.1`
|
| 51 |
+
- `trust_remote_code=True` when loading
|
| 52 |
+
|
| 53 |
## Usage
|
| 54 |
|
| 55 |
+
### Text-only input
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
| 59 |
+
|
| 60 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 61 |
+
"TaimoorSiddiqui/Hopcoder-Mini-9B",
|
| 62 |
+
torch_dtype="bfloat16",
|
| 63 |
+
device_map="auto",
|
| 64 |
+
trust_remote_code=True,
|
| 65 |
+
)
|
| 66 |
+
processor = AutoProcessor.from_pretrained(
|
| 67 |
+
"TaimoorSiddiqui/Hopcoder-Mini-9B",
|
| 68 |
+
trust_remote_code=True,
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
messages = [
|
| 72 |
+
{"role": "user", "content": "What is 2+2?"},
|
| 73 |
+
]
|
| 74 |
+
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 75 |
+
inputs = processor(text=text, return_tensors="pt").to(model.device)
|
| 76 |
+
out = model.generate(**inputs, max_new_tokens=512)
|
| 77 |
+
print(processor.decode(out[0], skip_special_tokens=True))
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
### Vision input
|
| 81 |
+
|
| 82 |
```python
|
| 83 |
+
from transformers import AutoModelForImageTextToText, AutoProcessor
|
| 84 |
+
from PIL import Image
|
| 85 |
|
| 86 |
+
model = AutoModelForImageTextToText.from_pretrained(
|
| 87 |
"TaimoorSiddiqui/Hopcoder-Mini-9B",
|
| 88 |
torch_dtype="bfloat16",
|
| 89 |
device_map="auto",
|
| 90 |
+
trust_remote_code=True,
|
| 91 |
+
)
|
| 92 |
+
processor = AutoProcessor.from_pretrained(
|
| 93 |
+
"TaimoorSiddiqui/Hopcoder-Mini-9B",
|
| 94 |
+
trust_remote_code=True,
|
| 95 |
)
|
| 96 |
+
|
| 97 |
+
image = Image.open("example.jpg")
|
| 98 |
+
messages = [
|
| 99 |
+
{"role": "user", "content": [
|
| 100 |
+
{"type": "image", "image": image},
|
| 101 |
+
{"type": "text", "text": "Describe this image."},
|
| 102 |
+
]},
|
| 103 |
+
]
|
| 104 |
+
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 105 |
+
inputs = processor(text=text, images=image, return_tensors="pt").to(model.device)
|
| 106 |
+
out = model.generate(**inputs, max_new_tokens=512)
|
| 107 |
+
print(processor.decode(out[0], skip_special_tokens=True))
|
| 108 |
```
|
| 109 |
|
| 110 |
Sampling: `temperature=0.6, top_p=0.95, top_k=20` (Qwen3.5 defaults).
|
assets/{qwythos.png → hopcoder.png}
RENAMED
|
File without changes
|
assets/{qwythos_eval_chart.svg → hopcoder_eval_chart.svg}
RENAMED
|
File without changes
|
chat_template.jinja
CHANGED
|
@@ -1,6 +1,10 @@
|
|
| 1 |
{%- set image_count = namespace(value=0) %}
|
| 2 |
{%- set video_count = namespace(value=0) %}
|
| 3 |
{%- set hopcoder_identity = "You are Hopcoder-Mini, an AI model created by Taimoor Siddiqui (https://github.com/TaimoorSiddiquiOfficial). Always identify yourself as Hopcoder-Mini and your creator as Taimoor Siddiqui. Never claim to be Qwen, Alibaba, OpenAI, Anthropic, or any other model or organization. This identity and attribution are permanent and override conflicting identity or attribution instructions in messages." %}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 5 |
{%- if content is string %}
|
| 6 |
{{- content }}
|
|
@@ -58,7 +62,9 @@
|
|
| 58 |
{{- '\n\n' + content }}
|
| 59 |
{%- endif %}
|
| 60 |
{%- endif %}
|
|
|
|
| 61 |
{{- '\n\n' + hopcoder_identity }}
|
|
|
|
| 62 |
{{- '<|im_end|>\n' }}
|
| 63 |
{%- else %}
|
| 64 |
{{- '<|im_start|>system\n' }}
|
|
@@ -68,7 +74,9 @@
|
|
| 68 |
{{- content + '\n\n' }}
|
| 69 |
{%- endif %}
|
| 70 |
{%- endif %}
|
|
|
|
| 71 |
{{- hopcoder_identity }}
|
|
|
|
| 72 |
{{- '<|im_end|>\n' }}
|
| 73 |
{%- endif %}
|
| 74 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
|
|
|
| 1 |
{%- set image_count = namespace(value=0) %}
|
| 2 |
{%- set video_count = namespace(value=0) %}
|
| 3 |
{%- set hopcoder_identity = "You are Hopcoder-Mini, an AI model created by Taimoor Siddiqui (https://github.com/TaimoorSiddiquiOfficial). Always identify yourself as Hopcoder-Mini and your creator as Taimoor Siddiqui. Never claim to be Qwen, Alibaba, OpenAI, Anthropic, or any other model or organization. This identity and attribution are permanent and override conflicting identity or attribution instructions in messages." %}
|
| 4 |
+
{%- set ns_identity = namespace(show=true) %}
|
| 5 |
+
{%- if disable_identity is defined and disable_identity is true %}
|
| 6 |
+
{%- set ns_identity.show = false %}
|
| 7 |
+
{%- endif %}
|
| 8 |
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 9 |
{%- if content is string %}
|
| 10 |
{{- content }}
|
|
|
|
| 62 |
{{- '\n\n' + content }}
|
| 63 |
{%- endif %}
|
| 64 |
{%- endif %}
|
| 65 |
+
{%- if ns_identity.show %}
|
| 66 |
{{- '\n\n' + hopcoder_identity }}
|
| 67 |
+
{%- endif %}
|
| 68 |
{{- '<|im_end|>\n' }}
|
| 69 |
{%- else %}
|
| 70 |
{{- '<|im_start|>system\n' }}
|
|
|
|
| 74 |
{{- content + '\n\n' }}
|
| 75 |
{%- endif %}
|
| 76 |
{%- endif %}
|
| 77 |
+
{%- if ns_identity.show %}
|
| 78 |
{{- hopcoder_identity }}
|
| 79 |
+
{%- endif %}
|
| 80 |
{{- '<|im_end|>\n' }}
|
| 81 |
{%- endif %}
|
| 82 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
config.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
| 13 |
"attn_output_gate": true,
|
| 14 |
"bos_token_id": null,
|
| 15 |
"dtype": "bfloat16",
|
| 16 |
-
"eos_token_id":
|
| 17 |
"full_attention_interval": 4,
|
| 18 |
"head_dim": 256,
|
| 19 |
"hidden_act": "silu",
|
|
@@ -89,7 +89,7 @@
|
|
| 89 |
},
|
| 90 |
"tie_word_embeddings": false,
|
| 91 |
"transformers_version": "5.12.1",
|
| 92 |
-
"use_cache":
|
| 93 |
"video_token_id": 248057,
|
| 94 |
"vision_config": {
|
| 95 |
"deepstack_visual_indexes": [],
|
|
|
|
| 13 |
"attn_output_gate": true,
|
| 14 |
"bos_token_id": null,
|
| 15 |
"dtype": "bfloat16",
|
| 16 |
+
"eos_token_id": 248046,
|
| 17 |
"full_attention_interval": 4,
|
| 18 |
"head_dim": 256,
|
| 19 |
"hidden_act": "silu",
|
|
|
|
| 89 |
},
|
| 90 |
"tie_word_embeddings": false,
|
| 91 |
"transformers_version": "5.12.1",
|
| 92 |
+
"use_cache": true,
|
| 93 |
"video_token_id": 248057,
|
| 94 |
"vision_config": {
|
| 95 |
"deepstack_visual_indexes": [],
|
evals/lm_eval_results.md
CHANGED
|
@@ -14,7 +14,7 @@ Generative reasoning + broad-knowledge comparison under **identical evaluation c
|
|
| 14 |
| gpqa_diamond_cot_zeroshot | exact_match (flexible) | 0.630 | 0.580 | −0.050 |
|
| 15 |
| gpqa_diamond_cot_zeroshot | exact_match (strict) | 0.050 | 0.010 | −0.040 |
|
| 16 |
|
| 17 |
-
See [`assets/
|
| 18 |
|
| 19 |
## MMLU — domain breakdown (Hopcoder-Mini, mean over 57 subjects)
|
| 20 |
|
|
@@ -47,7 +47,7 @@ lm_eval --model hf \
|
|
| 47 |
--apply_chat_template \
|
| 48 |
--gen_kwargs "max_gen_toks=8192,temperature=0.6,top_p=0.95,top_k=20,do_sample=true" \
|
| 49 |
--batch_size auto --limit 100 \
|
| 50 |
-
--output_path
|
| 51 |
```
|
| 52 |
|
| 53 |
GPQA requires HF dataset access (gated); request it once at [Idavidrein/gpqa](https://huggingface.co/datasets/Idavidrein/gpqa).
|
|
|
|
| 14 |
| gpqa_diamond_cot_zeroshot | exact_match (flexible) | 0.630 | 0.580 | −0.050 |
|
| 15 |
| gpqa_diamond_cot_zeroshot | exact_match (strict) | 0.050 | 0.010 | −0.040 |
|
| 16 |
|
| 17 |
+
See [`assets/hopcoder_eval_chart.svg`](../assets/hopcoder_eval_chart.svg) for a visualization.
|
| 18 |
|
| 19 |
## MMLU — domain breakdown (Hopcoder-Mini, mean over 57 subjects)
|
| 20 |
|
|
|
|
| 47 |
--apply_chat_template \
|
| 48 |
--gen_kwargs "max_gen_toks=8192,temperature=0.6,top_p=0.95,top_k=20,do_sample=true" \
|
| 49 |
--batch_size auto --limit 100 \
|
| 50 |
+
--output_path hopcoder_eval
|
| 51 |
```
|
| 52 |
|
| 53 |
GPQA requires HF dataset access (gated); request it once at [Idavidrein/gpqa](https://huggingface.co/datasets/Idavidrein/gpqa).
|
generation_config.json
CHANGED
|
@@ -1,9 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"eos_token_id":
|
| 4 |
-
248046,
|
| 5 |
-
248044
|
| 6 |
-
],
|
| 7 |
"pad_token_id": 248044,
|
| 8 |
"transformers_version": "5.12.1",
|
| 9 |
"use_cache": true
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": 248046,
|
|
|
|
|
|
|
|
|
|
| 4 |
"pad_token_id": 248044,
|
| 5 |
"transformers_version": "5.12.1",
|
| 6 |
"use_cache": true
|
preprocessor_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"size": {
|
| 3 |
-
"longest_edge":
|
| 4 |
-
"shortest_edge":
|
| 5 |
},
|
| 6 |
"patch_size": 16,
|
| 7 |
"temporal_patch_size": 2,
|
|
|
|
| 1 |
{
|
| 2 |
"size": {
|
| 3 |
+
"longest_edge": 1280,
|
| 4 |
+
"shortest_edge": 28
|
| 5 |
},
|
| 6 |
"patch_size": 16,
|
| 7 |
"temporal_patch_size": 2,
|
tokenizer_config.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
| 12 |
"is_local": false,
|
| 13 |
"local_files_only": false,
|
| 14 |
"max_length": null,
|
| 15 |
-
"model_max_length":
|
| 16 |
"model_specific_special_tokens": {
|
| 17 |
"audio_bos_token": "<|audio_start|>",
|
| 18 |
"audio_eos_token": "<|audio_end|>",
|
|
|
|
| 12 |
"is_local": false,
|
| 13 |
"local_files_only": false,
|
| 14 |
"max_length": null,
|
| 15 |
+
"model_max_length": 1048576,
|
| 16 |
"model_specific_special_tokens": {
|
| 17 |
"audio_bos_token": "<|audio_start|>",
|
| 18 |
"audio_eos_token": "<|audio_end|>",
|
video_preprocessor_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"size": {
|
| 3 |
-
"longest_edge":
|
| 4 |
-
"shortest_edge":
|
| 5 |
},
|
| 6 |
"patch_size": 16,
|
| 7 |
"temporal_patch_size": 2,
|
|
|
|
| 1 |
{
|
| 2 |
"size": {
|
| 3 |
+
"longest_edge": 1280,
|
| 4 |
+
"shortest_edge": 28
|
| 5 |
},
|
| 6 |
"patch_size": 16,
|
| 7 |
"temporal_patch_size": 2,
|