初始化项目,由ModelHub XC社区提供模型

Model: AlienKevin/marin-8b-instruct-sft-terminalcorpus
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-04-27 23:09:26 +08:00
commit ae7c774a39
16 changed files with 2467 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
tokenizer.json filter=lfs diff=lfs merge=lfs -text

73
README.md Normal file
View File

@@ -0,0 +1,73 @@
---
license: apache-2.0
base_model: marin-community/marin-8b-instruct
datasets:
- nvidia/Nemotron-Terminal-Corpus
tags:
- terminal
- agentic
- sft
- llama
- marin
language:
- en
pipeline_tag: text-generation
---
# Marin-8B-Instruct SFT on TerminalCorpus
Marin-8B Instruct fine-tuned on [nvidia/Nemotron-Terminal-Corpus](https://huggingface.co/datasets/nvidia/Nemotron-Terminal-Corpus) (366K terminal agent trajectories).
## Model Details
| Parameter | Value |
|---|---|
| Base model | [marin-community/marin-8b-instruct](https://huggingface.co/marin-community/marin-8b-instruct) |
| Architecture | Llama 3 8B (32 layers, 4096 hidden, 32 heads, 8 KV heads) |
| Tokenizer | [marin-community/marin-tokenizer](https://huggingface.co/marin-community/marin-tokenizer) |
| Training data | nvidia/Nemotron-Terminal-Corpus (366K examples, all 4 subsets) |
| Epochs | 2 |
| Training steps | 5,721 |
| Batch size | 128 |
| Sequence length | 32,768 |
| Learning rate | 2e-5 (cosine, 10% warmup) |
| Optimizer | AdamW (β=0.9/0.95), grad_clip=1.0, wd=1e-4 |
| TPU | v5p-64 |
| Final loss | 0.442 |
## Evaluation Results
### Terminal-Bench 2.0
| Model | TB2 Accuracy |
|---|---|
| Marin-8B Instruct (no SFT) | 0/89 = 0% |
| **Marin-8B Instruct + TerminalCorpus SFT** | **1/89 = 1.1%** |
| NemotronTerminal-8B (Qwen3-8B, paper) | 13.0% ± 2.2 |
| Marin Qwen3-8B SFT reproduction (exp3490b) | 14/88 = 15.9% |
### TBLite Progression
| Checkpoint | TBLite |
|---|---|
| Step 1500 (26%) | 1/100 = 1% |
| Step 3000 (52%) | 5/100 = 5% |
## Training Details
Trained following the [NemotronTerminal-8B](https://arxiv.org/abs/2602.21193) paper hyperparameters. The model reaches a higher final loss (0.442 vs 0.360) as the Qwen3-8B reproduction but scores significantly lower on terminal benchmarks, likely due to architecture and tokenizer differences between Llama 3 and Qwen3.
Tracked in: [marin-community/marin#4420](https://github.com/marin-community/marin/issues/4420)
## Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("AlienKevin/marin-8b-instruct-sft-terminalcorpus")
tokenizer = AutoTokenizer.from_pretrained("AlienKevin/marin-8b-instruct-sft-terminalcorpus")
```
## License
Apache 2.0

149
chat_template.jinja Normal file
View File

@@ -0,0 +1,149 @@
{{ bos_token }}
{%- if enable_thinking is defined -%}
{%- if enable_thinking is sameas true -%}
{%- set _reasoning_mode = "/think" -%}
{%- elif enable_thinking is sameas false -%}
{%- set _reasoning_mode = "/nothink" -%}
{%- else -%}
{%- set _reasoning_mode = enable_thinking -%}
{%- endif -%}
{%- else -%}
{%- set _reasoning_mode = none -%}
{%- endif -%}
{%- set _custom_instructions = custom_instructions | default(None, true) -%}
{%- set _xml_tools_list = xml_tools | default([], true) -%}
{%- if tools is defined and tools -%}
{%- set _xml_tools_list = tools -%}
{%- endif -%}
{%- set _python_tools = python_tools | default([], true) -%}
{%- set _has_aux_header = (_reasoning_mode is not none) or _custom_instructions or (_xml_tools_list) or (_python_tools) -%}
{%- if _has_aux_header -%}
<|start_header_id|>system<|end_header_id|>
{%- if _reasoning_mode is not none -%}
Reasoning: {{ _reasoning_mode }}
{%- endif %}
{%- if _custom_instructions %}
{{ _custom_instructions | trim }}
{%- endif %}
{% if _xml_tools_list or _python_tools %}
{{ "
### Tools
" }}
You may call one or more functions to assist with the user query.
{% if _xml_tools_list %}
You are provided with function signatures within <tools> </tools> tags:
<tools>
{% for tool in _xml_tools_list %}
{{ tool | string }}{% if not loop.last %}
{% endif %}
{% endfor %}
</tools>
For each function call, pass a json object with function name and arguments within <tool_call> </tool_call> tags:
<tool_call>
{"name": <function-name>, "arguments": <args-json-object>}
</tool_call>
{% endif %}
{% if _python_tools %}
When you send a message containing Python code between <|python_tag|> and <|eom_id|> tags, it will be executed in a stateful Jupyter notebook environment, and you will then be given the output.
You can use the following tools in your python code like regular functions:
<tools>
{% for tool in _python_tools %}
{{ tool | string }}{% if not loop.last %}
{% endif %}
{% endfor %}
</tools>
{% endif %}
{% endif %}
<|eot_id|>
{%- endif -%}
{%- for message in messages -%}
{%- set has_tool_calls = message.get('tool_calls') is not none and message.get('tool_calls') -%}
{%- if not (message.get('role') in ['tool', 'ipython'] or has_tool_calls) -%}
{%- if message.get('role') == 'assistant' -%}
<|start_header_id|>assistant<|end_header_id|>
{% set content = message.get('content') %}
{% if content is string %}
{% generation %}{{- content | trim }}<|eot_id|>{% endgeneration %}
{% elif content is mapping %}
{% generation %}{{- content.get('text', '') | trim }}<|eot_id|>{% endgeneration %}
{% elif content is iterable %}
{% generation %}
{%- for chunk in content -%}
{%- if chunk.get('type') == 'text' -%}
{{ chunk.get('text', '') | trim }}
{%- endif -%}
{%- endfor -%}
<|eot_id|>
{% endgeneration %}
{% else %}
{% generation %}{% endgeneration %}<|eot_id|>
{% endif %}
{%- else -%}
<|start_header_id|>{{ message['role'] }}<|end_header_id|>
{% set content = message.get('content') %}
{% if content is string %}
{{ content | trim }}<|eot_id|>
{% elif content is mapping %}
{{ content.get('text', '') | trim }}<|eot_id|>
{% elif content is iterable %}
{%- for chunk in content -%}
{%- if chunk.get('type') == 'text' -%}
{{ chunk.get('text', '') | trim }}
{%- endif -%}
{%- endfor -%}<|eot_id|>
{% else %}
<|eot_id|>
{% endif %}
{%- endif -%}
{%- elif message.get('role') == 'tool' -%}
{%- set _tool_name = message.get('name') -%}
{%- set _tool_id = message.get('tool_call_id') -%}
{%- set _attr_name = ' name="' ~ _tool_name ~ '"' if _tool_name else '' -%}
{%- set _attr_id = ' id="' ~ _tool_id ~ '"' if _tool_id else '' -%}
<|start_header_id|>tool<|end_header_id|>
<tool_response{{ _attr_name }}{{ _attr_id }}>
{%- set tool_content = message.get('content') -%}
{%- if tool_content is mapping or (tool_content is iterable and tool_content is not string) -%}
{{- tool_content | tojson }}
{%- else -%}
{{- tool_content if tool_content is not none else '' }}
{%- endif -%}
</tool_response><|eot_id|>
{{- "
" -}}
{%- elif message.get('role') == 'ipython' -%}
<|start_header_id|>ipython<|end_header_id|>
{% set ipy_content = message.get('content') %}
{% if ipy_content is string %}
{{- { "output": ipy_content } | tojson -}}
{% elif ipy_content is iterable %}
{%- for chunk in ipy_content -%}
{%- if chunk.get('type') == 'text' -%}
{{- { "output": chunk.get('text', '') } | tojson -}}
{%- endif -%}
{%- endfor -%}
{% else %}
{{- { "output": ipy_content } | tojson -}}
{% endif %}
<|eot_id|>
{% elif has_tool_calls -%}
{%- if message.tool_calls|length != 1 -%}
{{- raise_exception("This template expects exactly one tool call per assistant turn.") -}}
{%- endif -%}
{%- set tool_call = message.tool_calls[0].function -%}
<|start_header_id|>assistant<|end_header_id|>
{% generation %}
{{- '{"name": "' + tool_call.name + '", "arguments": ' -}}
{{- tool_call.arguments | tojson -}}
{{- "}" -}}<|eot_id|>
{% endgeneration %}
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt -%}
<|start_header_id|>assistant<|end_header_id|>
{% endif -%}

94
config.json Normal file
View File

@@ -0,0 +1,94 @@
{
"vocab_size": 128256,
"max_position_embeddings": 32768,
"hidden_size": 4096,
"intermediate_size": 14336,
"num_hidden_layers": 32,
"num_attention_heads": 32,
"num_key_value_heads": 8,
"hidden_act": "silu",
"initializer_range": 0.02,
"rms_norm_eps": 1e-05,
"pretraining_tp": 1,
"use_cache": true,
"rope_theta": 500000,
"rope_scaling": {
"factor": 8.0,
"low_freq_factor": 1.0,
"high_freq_factor": 4.0,
"original_max_position_embeddings": 8192,
"rope_type": "llama3"
},
"attention_bias": false,
"attention_dropout": 0.0,
"mlp_bias": false,
"head_dim": 128,
"return_dict": true,
"output_hidden_states": false,
"torchscript": false,
"dtype": null,
"pruned_heads": {},
"tie_word_embeddings": false,
"chunk_size_feed_forward": 0,
"is_encoder_decoder": false,
"is_decoder": false,
"cross_attention_hidden_size": null,
"add_cross_attention": false,
"tie_encoder_decoder": false,
"architectures": [
"LlamaForCausalLM"
],
"finetuning_task": null,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1"
},
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1
},
"task_specific_params": null,
"problem_type": null,
"tokenizer_class": null,
"prefix": null,
"bos_token_id": 128000,
"pad_token_id": null,
"eos_token_id": 128009,
"sep_token_id": null,
"decoder_start_token_id": 128000,
"max_length": 20,
"min_length": 0,
"do_sample": false,
"early_stopping": false,
"num_beams": 1,
"temperature": 1.0,
"top_k": 50,
"top_p": 1.0,
"typical_p": 1.0,
"repetition_penalty": 1.0,
"length_penalty": 1.0,
"no_repeat_ngram_size": 0,
"encoder_no_repeat_ngram_size": 0,
"bad_words_ids": null,
"num_return_sequences": 1,
"output_scores": false,
"return_dict_in_generate": false,
"forced_bos_token_id": null,
"forced_eos_token_id": null,
"remove_invalid_values": false,
"exponential_decay_length_penalty": null,
"suppress_tokens": null,
"begin_suppress_tokens": [
128000,
128001
],
"num_beam_groups": 1,
"diversity_penalty": 0.0,
"_name_or_path": "",
"transformers_version": "4.57.3",
"tf_legacy_loss": false,
"use_bfloat16": false,
"model_type": "llama",
"output_attentions": false,
"torch_dtype": "bfloat16"
}

12
generation_config.json Normal file
View File

@@ -0,0 +1,12 @@
{
"bos_token_id": 128000,
"do_sample": true,
"eos_token_id": [
128001,
128008,
128009
],
"temperature": 0.6,
"top_p": 0.9,
"transformers_version": "4.42.3"
}

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:642f3835c55b922d35dcbfa59ac404b12477dcacdedfdb28fdc8934bc5e5462f
size 4991255560

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:647071ce21fb9f5e820c930434f261af8c07b193e81e1c776b6cf673edbb92c5
size 4915910288

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84007abe64bb308bf19a8475bcf873e3f8d230a627da71735c66c0b11fb9efa5
size 4999813128

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f9348b22c318ba2172e23816547536bd84910f9276d9068a9098c12f63a4b337
size 4999813120

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:caa4b97e44b1bd77a4e5287fb010393e5d3209b28eadcfe7035915d4e22e38c5
size 4832007504

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b20385900d1780ef76d19fd5579652de2e807b80d813d9385fb9bc21c7359b5d
size 4999813096

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac69d3d4da8d996caeb1123f40f5ebf7018f1f62c1f06f28b658a823ebccd4aa
size 2382465960

File diff suppressed because one or more lines are too long

16
special_tokens_map.json Normal file
View File

@@ -0,0 +1,16 @@
{
"bos_token": {
"content": "<|begin_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|end_of_text|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.json Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:881c9c36c359e1617afef6f7583403567931b7b4f43f6552d2b2155a131650a2
size 17209892

2062
tokenizer_config.json Normal file

File diff suppressed because it is too large Load Diff