Instructions to use inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct") 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("inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct") model = AutoModelForMultimodalLM.from_pretrained("inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct
- SGLang
How to use inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct 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 "inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct" \ --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": "inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct" \ --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": "inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct with Docker Model Runner:
docker model run hf.co/inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +107 -0
- chat_template.jinja +111 -0
- checkpoint-500/config.json +120 -0
- checkpoint-500/generation_config.json +14 -0
- checkpoint-500/model.safetensors +3 -0
- checkpoint-500/optimizer.pt +3 -0
- checkpoint-500/rng_state.pth +3 -0
- checkpoint-500/scheduler.pt +3 -0
- checkpoint-500/trainer_state.json +391 -0
- checkpoint-500/training_args.bin +3 -0
- config.json +120 -0
- generation_config.json +14 -0
- model.safetensors +3 -0
- processor_config.json +33 -0
- tokenizer.json +3 -0
- tokenizer_config.json +16 -0
- training_args.bin +3 -0
.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
|
README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model:
|
| 4 |
+
- meta-llama/Llama-4-Scout-17B-16E-Instruct
|
| 5 |
+
library_name: transformers
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# Llama-4-Scout-1.7B-0.4B-Instruct
|
| 9 |
+
|
| 10 |
+
This is a tiny version of [meta-llama/Llama-4-Scout-17B-16E-Instruct](https://huggingface.co/meta-llama/Llama-4-Scout-17B-16E-Instruct) created for testing and development.
|
| 11 |
+
|
| 12 |
+
## Model Details
|
| 13 |
+
|
| 14 |
+
- **Base Model**: meta-llama/Llama-4-Scout-17B-16E-Instruct
|
| 15 |
+
- **Architecture**: llama4 (multimodal vision-language with MoE)
|
| 16 |
+
- **Total Parameters**: 1.72B
|
| 17 |
+
- **Activated Parameters**: ~0.43B (1 expert activated per token out of 4)
|
| 18 |
+
|
| 19 |
+
## Configuration Changes
|
| 20 |
+
|
| 21 |
+
The following parameters were reduced from the original model:
|
| 22 |
+
|
| 23 |
+
| Parameter | Original | Tiny |
|
| 24 |
+
|-----------|----------|------|
|
| 25 |
+
| **Text Model** | | |
|
| 26 |
+
| num_hidden_layers | 48 | 8 |
|
| 27 |
+
| num_local_experts | 16 | 4 |
|
| 28 |
+
| num_experts_per_tok | 1 | 1 |
|
| 29 |
+
| hidden_size | 5120 | 2048 |
|
| 30 |
+
| intermediate_size | 8192 | 3072 |
|
| 31 |
+
| intermediate_size_mlp | 16384 | 6144 |
|
| 32 |
+
| num_attention_heads | 40 | 16 |
|
| 33 |
+
| num_key_value_heads | 8 | 4 |
|
| 34 |
+
| layer_types | 48 layers (chunked/full pattern) | 8 layers (maintains 3:1 pattern) |
|
| 35 |
+
| **Vision Model** | | |
|
| 36 |
+
| num_hidden_layers | 34 | 6 |
|
| 37 |
+
| hidden_size | 1408 | 768 |
|
| 38 |
+
| intermediate_size | 5632 | 3072 |
|
| 39 |
+
| num_attention_heads | 16 | 12 |
|
| 40 |
+
|
| 41 |
+
## Architecture Preservation
|
| 42 |
+
|
| 43 |
+
The tiny model maintains the original Llama-4-Scout architecture patterns:
|
| 44 |
+
- **MoE Structure**: Retained mixture-of-experts with shared expert
|
| 45 |
+
- **Attention Pattern**: Maintains the chunked_attention/full_attention pattern (every 4th layer is full_attention)
|
| 46 |
+
- **No-RoPE Layers**: Preserved the pattern where 3 out of every 4 layers use alternative position encoding
|
| 47 |
+
|
| 48 |
+
## Checkpoint Structure
|
| 49 |
+
|
| 50 |
+
The model is saved as a single safetensors file following the original checkpoint structure:
|
| 51 |
+
- `language_model.model.layers.{X}.feed_forward.experts.*`
|
| 52 |
+
- `language_model.model.layers.{X}.feed_forward.shared_expert.*`
|
| 53 |
+
- `vision_model.model.layers.{X}.*`
|
| 54 |
+
|
| 55 |
+
This structure is compatible with transformers' `Llama4ForConditionalGeneration`.
|
| 56 |
+
|
| 57 |
+
## Usage
|
| 58 |
+
|
| 59 |
+
```python
|
| 60 |
+
from transformers import Llama4ForConditionalGeneration, AutoProcessor
|
| 61 |
+
|
| 62 |
+
model = Llama4ForConditionalGeneration.from_pretrained(
|
| 63 |
+
"inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct",
|
| 64 |
+
device_map="auto"
|
| 65 |
+
)
|
| 66 |
+
processor = AutoProcessor.from_pretrained("inference-optimization/Llama-4-Scout-1.7B-0.4B-Instruct")
|
| 67 |
+
|
| 68 |
+
# Text-only input
|
| 69 |
+
text = "Hello, world!"
|
| 70 |
+
inputs = processor.tokenizer(text, return_tensors="pt").to(model.device)
|
| 71 |
+
outputs = model.generate(**inputs, max_new_tokens=20)
|
| 72 |
+
print(processor.tokenizer.decode(outputs[0]))
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
## Creation Process
|
| 76 |
+
|
| 77 |
+
This model was created using the llm-compressor `create-tiny-model` skill:
|
| 78 |
+
|
| 79 |
+
1. **Config Modification**: Reduced layers, experts, and hidden dimensions while preserving architectural patterns
|
| 80 |
+
2. **Weight Initialization**: Randomly initialized weights using the model's init_weights() method
|
| 81 |
+
3. **Fine-tuning Attempt**: Attempted text-only fine-tuning on a small corpus (note: the multimodal architecture made standard text-only fine-tuning ineffective, but the model structure is valid)
|
| 82 |
+
4. **Validation**: Verified model loads correctly and can perform inference
|
| 83 |
+
|
| 84 |
+
## Notes
|
| 85 |
+
|
| 86 |
+
**Important**: This is a tiny model with randomly initialized weights intended for **testing and development purposes only**. It is not trained and will not produce meaningful outputs. The vision tower is completely untrained.
|
| 87 |
+
|
| 88 |
+
### Use Cases
|
| 89 |
+
- Testing model loading and inference pipelines
|
| 90 |
+
- Validating quantization and compression workflows
|
| 91 |
+
- Debugging multimodal model handling
|
| 92 |
+
- CI/CD pipeline testing with realistic model sizes
|
| 93 |
+
- Memory profiling and optimization experiments
|
| 94 |
+
|
| 95 |
+
### Limitations
|
| 96 |
+
- Randomly initialized weights (not trained)
|
| 97 |
+
- Will generate nonsensical outputs
|
| 98 |
+
- Vision capabilities are non-functional
|
| 99 |
+
- Not suitable for any production use or evaluation benchmarks
|
| 100 |
+
|
| 101 |
+
## Technical Warnings
|
| 102 |
+
|
| 103 |
+
When loading this model, you may see the warning:
|
| 104 |
+
```
|
| 105 |
+
[transformers] `rope_parameters`'s high_freq_factor field must be greater than low_freq_factor
|
| 106 |
+
```
|
| 107 |
+
This is a known issue with the Llama-4 config and can be safely ignored.
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token }}
|
| 2 |
+
{%- if custom_tools is defined and custom_tools%}
|
| 3 |
+
{%- set tools = custom_tools %}
|
| 4 |
+
{%- endif %}
|
| 5 |
+
{%- if tools is defined and tools %}
|
| 6 |
+
{%- set tool_definition = tool_definition ~ (tools | tojson(indent=4)) %}
|
| 7 |
+
{%- else %}
|
| 8 |
+
{%- set tools = none %}
|
| 9 |
+
{%- endif %}
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
{#- This block extracts the system message, so we can slot it into the right place. #}
|
| 13 |
+
{%- if messages[0]['role'] == 'system' %}
|
| 14 |
+
{%- set user_provided_system_message = true %}
|
| 15 |
+
{%- if messages[0]['content'] is string %}
|
| 16 |
+
{%- set system_message = messages[0]['content']|trim %}
|
| 17 |
+
{%- else %}
|
| 18 |
+
{%- set system_message = messages[0]['content'][0]['text']|trim %}
|
| 19 |
+
{%- endif %}
|
| 20 |
+
{%- set messages = messages[1:] %}
|
| 21 |
+
{%- else %}
|
| 22 |
+
{%- if tools is not none %}
|
| 23 |
+
{#- Since not system_message was provided by user, if tool is provided, system_message is now default tool system message #}
|
| 24 |
+
{#- This system message is from llama website:https://www.llama.com/docs/model-cards-and-prompt-formats/llama4/ #}
|
| 25 |
+
{%- set system_message = "You are a helpful assistant and an expert in function composition. You can answer general questions using your internal knowledge OR invoke functions when necessary. Follow these strict guidelines:\n\n1. FUNCTION CALLS:\n- ONLY use functions that are EXPLICITLY listed in the function list below\n- If NO functions are listed (empty function list []), respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If a function is not in the list, respond ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\"\n- If ALL required parameters are present AND the query EXACTLY matches a listed function's purpose: output ONLY the function call(s)\n- Use exact format: [func_name1(param1=value1, param2=value2), func_name2(...)]\nExamples:\nCORRECT: [get_weather(location=\"Vancouver\"), calculate_route(start=\"Boston\", end=\"New York\")] <- Only if get_weather and calculate_route are in function list\nINCORRECT: get_weather(location=\"New York\")\nINCORRECT: Let me check the weather: [get_weather(location=\"New York\")]\nINCORRECT: [get_events(location=\"Singapore\")] <- If function not in list\n\n2. RESPONSE RULES:\n- For pure function requests matching a listed function: ONLY output the function call(s)\n- For knowledge questions: ONLY output text\n- For missing parameters: ONLY request the specific missing parameters\n- For unavailable services (not in function list): output ONLY with internal knowledge or \"I don't have access to [Unavailable service] information\". Do NOT execute a function call.\n- If the query asks for information beyond what a listed function provides: output ONLY with internal knowledge about your limitations\n- NEVER combine text and function calls in the same response\n- NEVER suggest alternative functions when the requested service is unavailable\n- NEVER create or invent new functions not listed below\n\n3. STRICT BOUNDARIES:\n- ONLY use functions from the list below - no exceptions\n- NEVER use a function as an alternative to unavailable information\n- NEVER call functions not present in the function list\n- NEVER add explanatory text to function calls\n- NEVER respond with empty brackets\n- Use proper Python/JSON syntax for function calls\n- Check the function list carefully before responding\n\n4. TOOL RESPONSE HANDLING:\n- When receiving tool responses: provide concise, natural language responses\n- Don't repeat tool response verbatim\n- Don't add supplementary information\n\nHere is a list of functions in JSON format that you can invoke:\n" %}
|
| 26 |
+
{%- else %}
|
| 27 |
+
{%- set system_message = "" %}
|
| 28 |
+
{%- endif %}
|
| 29 |
+
{%- endif %}
|
| 30 |
+
{#- Now writing the system message: use the user provided system message if user_provided_system_message, else default tool system message if tools presented #}
|
| 31 |
+
{%- if system_message %}
|
| 32 |
+
{#- always use user provided system message to override default tool system message #}
|
| 33 |
+
{{- "<|header_start|>system<|header_end|>\n\n" }}
|
| 34 |
+
{{- system_message }}
|
| 35 |
+
{%- if user_provided_system_message and tools %}
|
| 36 |
+
{{- "\nHere is a list of functions in JSON format that you can invoke. Use exact format: [func_name1(param1=value1, param2=value2), func_name2(...)]\n" }}
|
| 37 |
+
{{- tool_definition -}}
|
| 38 |
+
{%- elif tool_definition %}
|
| 39 |
+
{{- tool_definition -}}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{{- "<|eot|>" }}
|
| 42 |
+
{%- endif %}
|
| 43 |
+
|
| 44 |
+
{#- Now deal with all other messages #}
|
| 45 |
+
{%- for message in messages %}
|
| 46 |
+
{#- Base case: messages that are not from tool role and has empty tool_call list #}
|
| 47 |
+
{%- if not (message.role == 'ipython' or message.role == 'tool' or ('tool_calls' in message and message.tool_calls|length != 0 )) %}
|
| 48 |
+
{{- '<|header_start|>' + message['role'] + '<|header_end|>\n\n' }}
|
| 49 |
+
{%- if message['content'] is string %}
|
| 50 |
+
{{- message['content'] }}
|
| 51 |
+
{%- else %}
|
| 52 |
+
{%- for content in message['content'] %}
|
| 53 |
+
{%- if content['type'] == 'image' %}
|
| 54 |
+
{{- '<|image|>' }}
|
| 55 |
+
{%- elif content['type'] == 'text' %}
|
| 56 |
+
{{- content['text'] | trim }}
|
| 57 |
+
{%- endif %}
|
| 58 |
+
{%- endfor %}
|
| 59 |
+
{%- endif %}
|
| 60 |
+
{{- "<|eot|>" }}
|
| 61 |
+
{#- Tool case: messages has non-empty tool_call list, must from assistant #}
|
| 62 |
+
{%- elif 'tool_calls' in message %}
|
| 63 |
+
{#- assume tool_calls are always coming from assistant #}
|
| 64 |
+
{%- if message.role == 'assistant' %}
|
| 65 |
+
{{- '<|header_start|>assistant<|header_end|>\n\n' -}}
|
| 66 |
+
{%- if message['content'] is string %}
|
| 67 |
+
{{- message['content'] }}
|
| 68 |
+
{%- else %}
|
| 69 |
+
{%- for content in message['content'] %}
|
| 70 |
+
{%- if content['type'] == 'image' %}
|
| 71 |
+
{{- '<|image|>' }}
|
| 72 |
+
{%- elif content['type'] == 'text' %}
|
| 73 |
+
{{- content['text'] }}
|
| 74 |
+
{%- endif %}
|
| 75 |
+
{%- endfor %}
|
| 76 |
+
{%- endif %}
|
| 77 |
+
{{- "[" }}
|
| 78 |
+
{%- for tool_call in message.tool_calls %}
|
| 79 |
+
{%- if tool_call.function is defined %}
|
| 80 |
+
{%- set tool_call = tool_call.function %}
|
| 81 |
+
{%- endif %}
|
| 82 |
+
{{- tool_call.name + '(' -}}
|
| 83 |
+
{%- for param in tool_call.arguments %}
|
| 84 |
+
{{- param + '="' -}}
|
| 85 |
+
{{- "%s" | format(tool_call.arguments[param]) -}}
|
| 86 |
+
{{- '"' -}}
|
| 87 |
+
{% if not loop.last %}, {% endif %}
|
| 88 |
+
{%- endfor %}
|
| 89 |
+
{{- ')' -}}
|
| 90 |
+
{% if not loop.last %}, {% endif %}
|
| 91 |
+
{%- endfor %}
|
| 92 |
+
{{- "]<|eot|>" }}
|
| 93 |
+
{%- endif %}
|
| 94 |
+
{#- Tool_response case: messages are from tool_response #}
|
| 95 |
+
{%- elif message.role == "tool" or message.role == "ipython" %}
|
| 96 |
+
{{- "<|header_start|>ipython<|header_end|>\n\n" }}
|
| 97 |
+
{%- if message.content is string %}
|
| 98 |
+
{{- message.content | tojson }}
|
| 99 |
+
{%- else %}
|
| 100 |
+
{%- for content in message['content'] %}
|
| 101 |
+
{%- if content['type'] == 'text' %}
|
| 102 |
+
{{- content['text'] | tojson }}
|
| 103 |
+
{%- endif %}
|
| 104 |
+
{%- endfor %}
|
| 105 |
+
{%- endif %}
|
| 106 |
+
{{- "<|eot|>" }}
|
| 107 |
+
{%- endif %}
|
| 108 |
+
{%- endfor %}
|
| 109 |
+
{%- if add_generation_prompt %}
|
| 110 |
+
{{- '<|header_start|>assistant<|header_end|>\n\n' }}
|
| 111 |
+
{%- endif %}
|
checkpoint-500/config.json
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Llama4ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"boi_token_index": 200080,
|
| 6 |
+
"dtype": "float32",
|
| 7 |
+
"eoi_token_index": 200081,
|
| 8 |
+
"image_token_index": 200092,
|
| 9 |
+
"model_type": "llama4",
|
| 10 |
+
"text_config": {
|
| 11 |
+
"_attn_implementation_autoset": true,
|
| 12 |
+
"attention_bias": false,
|
| 13 |
+
"attention_chunk_size": 8192,
|
| 14 |
+
"attention_dropout": 0.0,
|
| 15 |
+
"attn_scale": 0.1,
|
| 16 |
+
"attn_temperature_tuning": true,
|
| 17 |
+
"bos_token_id": 200000,
|
| 18 |
+
"dtype": "float32",
|
| 19 |
+
"eos_token_id": [
|
| 20 |
+
200001,
|
| 21 |
+
200007,
|
| 22 |
+
200008
|
| 23 |
+
],
|
| 24 |
+
"floor_scale": 8192,
|
| 25 |
+
"for_llm_compressor": false,
|
| 26 |
+
"head_dim": 128,
|
| 27 |
+
"hidden_act": "silu",
|
| 28 |
+
"hidden_size": 2048,
|
| 29 |
+
"initializer_range": 0.02,
|
| 30 |
+
"interleave_moe_layer_step": 1,
|
| 31 |
+
"intermediate_size": 3072,
|
| 32 |
+
"intermediate_size_mlp": 6144,
|
| 33 |
+
"layer_types": [
|
| 34 |
+
"chunked_attention",
|
| 35 |
+
"chunked_attention",
|
| 36 |
+
"chunked_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"chunked_attention",
|
| 39 |
+
"chunked_attention",
|
| 40 |
+
"chunked_attention",
|
| 41 |
+
"full_attention"
|
| 42 |
+
],
|
| 43 |
+
"max_position_embeddings": 10485760,
|
| 44 |
+
"model_type": "llama4_text",
|
| 45 |
+
"moe_layers": [
|
| 46 |
+
0,
|
| 47 |
+
1,
|
| 48 |
+
2,
|
| 49 |
+
3,
|
| 50 |
+
4,
|
| 51 |
+
5,
|
| 52 |
+
6,
|
| 53 |
+
7
|
| 54 |
+
],
|
| 55 |
+
"no_rope_layer_interval": 4,
|
| 56 |
+
"no_rope_layers": [
|
| 57 |
+
1,
|
| 58 |
+
1,
|
| 59 |
+
1,
|
| 60 |
+
0,
|
| 61 |
+
1,
|
| 62 |
+
1,
|
| 63 |
+
1,
|
| 64 |
+
0
|
| 65 |
+
],
|
| 66 |
+
"num_attention_heads": 16,
|
| 67 |
+
"num_experts_per_tok": 1,
|
| 68 |
+
"num_hidden_layers": 8,
|
| 69 |
+
"num_key_value_heads": 4,
|
| 70 |
+
"num_local_experts": 4,
|
| 71 |
+
"output_router_logits": false,
|
| 72 |
+
"pad_token_id": 200018,
|
| 73 |
+
"rms_norm_eps": 1e-05,
|
| 74 |
+
"rope_parameters": {
|
| 75 |
+
"factor": 16.0,
|
| 76 |
+
"high_freq_factor": 1.0,
|
| 77 |
+
"low_freq_factor": 1.0,
|
| 78 |
+
"original_max_position_embeddings": 8192,
|
| 79 |
+
"rope_theta": 500000.0,
|
| 80 |
+
"rope_type": "llama3"
|
| 81 |
+
},
|
| 82 |
+
"router_aux_loss_coef": 0.001,
|
| 83 |
+
"router_jitter_noise": 0.0,
|
| 84 |
+
"tie_word_embeddings": false,
|
| 85 |
+
"use_cache": true,
|
| 86 |
+
"use_qk_norm": true,
|
| 87 |
+
"vocab_size": 202048
|
| 88 |
+
},
|
| 89 |
+
"tie_word_embeddings": false,
|
| 90 |
+
"transformers_version": "5.10.1",
|
| 91 |
+
"use_cache": false,
|
| 92 |
+
"vision_config": {
|
| 93 |
+
"_attn_implementation_autoset": true,
|
| 94 |
+
"attention_dropout": 0.0,
|
| 95 |
+
"dtype": "float32",
|
| 96 |
+
"hidden_act": "gelu",
|
| 97 |
+
"hidden_size": 768,
|
| 98 |
+
"image_size": 336,
|
| 99 |
+
"initializer_range": 0.02,
|
| 100 |
+
"intermediate_size": 3072,
|
| 101 |
+
"model_type": "llama4_vision_model",
|
| 102 |
+
"multi_modal_projector_bias": false,
|
| 103 |
+
"norm_eps": 1e-05,
|
| 104 |
+
"num_attention_heads": 12,
|
| 105 |
+
"num_channels": 3,
|
| 106 |
+
"num_hidden_layers": 6,
|
| 107 |
+
"patch_size": 14,
|
| 108 |
+
"pixel_shuffle_ratio": 0.5,
|
| 109 |
+
"projector_dropout": 0.0,
|
| 110 |
+
"projector_input_dim": 2048,
|
| 111 |
+
"projector_output_dim": 2048,
|
| 112 |
+
"rope_parameters": {
|
| 113 |
+
"rope_theta": 10000,
|
| 114 |
+
"rope_type": "default"
|
| 115 |
+
},
|
| 116 |
+
"vision_feature_layer": -1,
|
| 117 |
+
"vision_feature_select_strategy": "default",
|
| 118 |
+
"vision_output_dim": 2048
|
| 119 |
+
}
|
| 120 |
+
}
|
checkpoint-500/generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 200000,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
200001,
|
| 6 |
+
200007,
|
| 7 |
+
200008
|
| 8 |
+
],
|
| 9 |
+
"output_attentions": false,
|
| 10 |
+
"output_hidden_states": false,
|
| 11 |
+
"pad_token_id": 200018,
|
| 12 |
+
"transformers_version": "5.10.1",
|
| 13 |
+
"use_cache": true
|
| 14 |
+
}
|
checkpoint-500/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:739252e404227a38b8f48330f3fa86169e7c162382cd134cb2743dda6b333ec3
|
| 3 |
+
size 6898648848
|
checkpoint-500/optimizer.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:757c8865bc6fb275bd2bd43e19c1fb1d8104fca25c210766a47538a941bfd0d7
|
| 3 |
+
size 13332487139
|
checkpoint-500/rng_state.pth
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ad039bf1b460e4f46a4f0c9fde92bda8a17a5127d6c3692469420560b3b1c3ff
|
| 3 |
+
size 14645
|
checkpoint-500/scheduler.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3105ebe8471f9890c3eb1f20cc0f2520fa5fdb0128474bbc87e607b2ec7c53dc
|
| 3 |
+
size 1465
|
checkpoint-500/trainer_state.json
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"best_global_step": null,
|
| 3 |
+
"best_metric": null,
|
| 4 |
+
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 125.0,
|
| 6 |
+
"eval_steps": 500,
|
| 7 |
+
"global_step": 500,
|
| 8 |
+
"is_hyper_param_search": false,
|
| 9 |
+
"is_local_process_zero": true,
|
| 10 |
+
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [
|
| 12 |
+
{
|
| 13 |
+
"epoch": 0.25,
|
| 14 |
+
"grad_norm": 0.0,
|
| 15 |
+
"learning_rate": 5e-05,
|
| 16 |
+
"loss": 12.21626091003418,
|
| 17 |
+
"step": 1
|
| 18 |
+
},
|
| 19 |
+
{
|
| 20 |
+
"epoch": 2.5,
|
| 21 |
+
"grad_norm": 0.0,
|
| 22 |
+
"learning_rate": 4.91e-05,
|
| 23 |
+
"loss": 12.21626196967231,
|
| 24 |
+
"step": 10
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"epoch": 5.0,
|
| 28 |
+
"grad_norm": 0.0,
|
| 29 |
+
"learning_rate": 4.8100000000000004e-05,
|
| 30 |
+
"loss": 12.216262054443359,
|
| 31 |
+
"step": 20
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"epoch": 7.5,
|
| 35 |
+
"grad_norm": 0.0,
|
| 36 |
+
"learning_rate": 4.71e-05,
|
| 37 |
+
"loss": 12.216262054443359,
|
| 38 |
+
"step": 30
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"epoch": 10.0,
|
| 42 |
+
"grad_norm": 0.0,
|
| 43 |
+
"learning_rate": 4.61e-05,
|
| 44 |
+
"loss": 12.216262054443359,
|
| 45 |
+
"step": 40
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"epoch": 12.5,
|
| 49 |
+
"grad_norm": 0.0,
|
| 50 |
+
"learning_rate": 4.5100000000000005e-05,
|
| 51 |
+
"loss": 12.216262054443359,
|
| 52 |
+
"step": 50
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"epoch": 15.0,
|
| 56 |
+
"grad_norm": 0.0,
|
| 57 |
+
"learning_rate": 4.41e-05,
|
| 58 |
+
"loss": 12.216262054443359,
|
| 59 |
+
"step": 60
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"epoch": 17.5,
|
| 63 |
+
"grad_norm": 0.0,
|
| 64 |
+
"learning_rate": 4.3100000000000004e-05,
|
| 65 |
+
"loss": 12.216262054443359,
|
| 66 |
+
"step": 70
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"epoch": 20.0,
|
| 70 |
+
"grad_norm": 0.0,
|
| 71 |
+
"learning_rate": 4.21e-05,
|
| 72 |
+
"loss": 12.216262054443359,
|
| 73 |
+
"step": 80
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"epoch": 22.5,
|
| 77 |
+
"grad_norm": 0.0,
|
| 78 |
+
"learning_rate": 4.11e-05,
|
| 79 |
+
"loss": 12.216262054443359,
|
| 80 |
+
"step": 90
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"epoch": 25.0,
|
| 84 |
+
"grad_norm": 0.0,
|
| 85 |
+
"learning_rate": 4.0100000000000006e-05,
|
| 86 |
+
"loss": 12.216262054443359,
|
| 87 |
+
"step": 100
|
| 88 |
+
},
|
| 89 |
+
{
|
| 90 |
+
"epoch": 27.5,
|
| 91 |
+
"grad_norm": 0.0,
|
| 92 |
+
"learning_rate": 3.91e-05,
|
| 93 |
+
"loss": 12.216262054443359,
|
| 94 |
+
"step": 110
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"epoch": 30.0,
|
| 98 |
+
"grad_norm": 0.0,
|
| 99 |
+
"learning_rate": 3.8100000000000005e-05,
|
| 100 |
+
"loss": 12.216262054443359,
|
| 101 |
+
"step": 120
|
| 102 |
+
},
|
| 103 |
+
{
|
| 104 |
+
"epoch": 32.5,
|
| 105 |
+
"grad_norm": 0.0,
|
| 106 |
+
"learning_rate": 3.71e-05,
|
| 107 |
+
"loss": 12.216262054443359,
|
| 108 |
+
"step": 130
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"epoch": 35.0,
|
| 112 |
+
"grad_norm": 0.0,
|
| 113 |
+
"learning_rate": 3.61e-05,
|
| 114 |
+
"loss": 12.216262054443359,
|
| 115 |
+
"step": 140
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"epoch": 37.5,
|
| 119 |
+
"grad_norm": 0.0,
|
| 120 |
+
"learning_rate": 3.51e-05,
|
| 121 |
+
"loss": 12.216262054443359,
|
| 122 |
+
"step": 150
|
| 123 |
+
},
|
| 124 |
+
{
|
| 125 |
+
"epoch": 40.0,
|
| 126 |
+
"grad_norm": 0.0,
|
| 127 |
+
"learning_rate": 3.41e-05,
|
| 128 |
+
"loss": 12.216262054443359,
|
| 129 |
+
"step": 160
|
| 130 |
+
},
|
| 131 |
+
{
|
| 132 |
+
"epoch": 42.5,
|
| 133 |
+
"grad_norm": 0.0,
|
| 134 |
+
"learning_rate": 3.3100000000000005e-05,
|
| 135 |
+
"loss": 12.216262054443359,
|
| 136 |
+
"step": 170
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"epoch": 45.0,
|
| 140 |
+
"grad_norm": 0.0,
|
| 141 |
+
"learning_rate": 3.21e-05,
|
| 142 |
+
"loss": 12.216262054443359,
|
| 143 |
+
"step": 180
|
| 144 |
+
},
|
| 145 |
+
{
|
| 146 |
+
"epoch": 47.5,
|
| 147 |
+
"grad_norm": 0.0,
|
| 148 |
+
"learning_rate": 3.1100000000000004e-05,
|
| 149 |
+
"loss": 12.216262054443359,
|
| 150 |
+
"step": 190
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"epoch": 50.0,
|
| 154 |
+
"grad_norm": 0.0,
|
| 155 |
+
"learning_rate": 3.01e-05,
|
| 156 |
+
"loss": 12.216262054443359,
|
| 157 |
+
"step": 200
|
| 158 |
+
},
|
| 159 |
+
{
|
| 160 |
+
"epoch": 52.5,
|
| 161 |
+
"grad_norm": 0.0,
|
| 162 |
+
"learning_rate": 2.91e-05,
|
| 163 |
+
"loss": 12.216262054443359,
|
| 164 |
+
"step": 210
|
| 165 |
+
},
|
| 166 |
+
{
|
| 167 |
+
"epoch": 55.0,
|
| 168 |
+
"grad_norm": 0.0,
|
| 169 |
+
"learning_rate": 2.8100000000000005e-05,
|
| 170 |
+
"loss": 12.216262054443359,
|
| 171 |
+
"step": 220
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"epoch": 57.5,
|
| 175 |
+
"grad_norm": 0.0,
|
| 176 |
+
"learning_rate": 2.7100000000000005e-05,
|
| 177 |
+
"loss": 12.216262054443359,
|
| 178 |
+
"step": 230
|
| 179 |
+
},
|
| 180 |
+
{
|
| 181 |
+
"epoch": 60.0,
|
| 182 |
+
"grad_norm": 0.0,
|
| 183 |
+
"learning_rate": 2.61e-05,
|
| 184 |
+
"loss": 12.216262054443359,
|
| 185 |
+
"step": 240
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"epoch": 62.5,
|
| 189 |
+
"grad_norm": 0.0,
|
| 190 |
+
"learning_rate": 2.51e-05,
|
| 191 |
+
"loss": 12.216262054443359,
|
| 192 |
+
"step": 250
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"epoch": 65.0,
|
| 196 |
+
"grad_norm": 0.0,
|
| 197 |
+
"learning_rate": 2.41e-05,
|
| 198 |
+
"loss": 12.216262054443359,
|
| 199 |
+
"step": 260
|
| 200 |
+
},
|
| 201 |
+
{
|
| 202 |
+
"epoch": 67.5,
|
| 203 |
+
"grad_norm": 0.0,
|
| 204 |
+
"learning_rate": 2.3100000000000002e-05,
|
| 205 |
+
"loss": 12.216262054443359,
|
| 206 |
+
"step": 270
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"epoch": 70.0,
|
| 210 |
+
"grad_norm": 0.0,
|
| 211 |
+
"learning_rate": 2.2100000000000002e-05,
|
| 212 |
+
"loss": 12.216262054443359,
|
| 213 |
+
"step": 280
|
| 214 |
+
},
|
| 215 |
+
{
|
| 216 |
+
"epoch": 72.5,
|
| 217 |
+
"grad_norm": 0.0,
|
| 218 |
+
"learning_rate": 2.11e-05,
|
| 219 |
+
"loss": 12.216262054443359,
|
| 220 |
+
"step": 290
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"epoch": 75.0,
|
| 224 |
+
"grad_norm": 0.0,
|
| 225 |
+
"learning_rate": 2.01e-05,
|
| 226 |
+
"loss": 12.216262054443359,
|
| 227 |
+
"step": 300
|
| 228 |
+
},
|
| 229 |
+
{
|
| 230 |
+
"epoch": 77.5,
|
| 231 |
+
"grad_norm": 0.0,
|
| 232 |
+
"learning_rate": 1.91e-05,
|
| 233 |
+
"loss": 12.216262054443359,
|
| 234 |
+
"step": 310
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"epoch": 80.0,
|
| 238 |
+
"grad_norm": 0.0,
|
| 239 |
+
"learning_rate": 1.81e-05,
|
| 240 |
+
"loss": 12.216262054443359,
|
| 241 |
+
"step": 320
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"epoch": 82.5,
|
| 245 |
+
"grad_norm": 0.0,
|
| 246 |
+
"learning_rate": 1.7100000000000002e-05,
|
| 247 |
+
"loss": 12.216262054443359,
|
| 248 |
+
"step": 330
|
| 249 |
+
},
|
| 250 |
+
{
|
| 251 |
+
"epoch": 85.0,
|
| 252 |
+
"grad_norm": 0.0,
|
| 253 |
+
"learning_rate": 1.6100000000000002e-05,
|
| 254 |
+
"loss": 12.216262054443359,
|
| 255 |
+
"step": 340
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"epoch": 87.5,
|
| 259 |
+
"grad_norm": 0.0,
|
| 260 |
+
"learning_rate": 1.51e-05,
|
| 261 |
+
"loss": 12.216262054443359,
|
| 262 |
+
"step": 350
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"epoch": 90.0,
|
| 266 |
+
"grad_norm": 0.0,
|
| 267 |
+
"learning_rate": 1.4099999999999999e-05,
|
| 268 |
+
"loss": 12.216262054443359,
|
| 269 |
+
"step": 360
|
| 270 |
+
},
|
| 271 |
+
{
|
| 272 |
+
"epoch": 92.5,
|
| 273 |
+
"grad_norm": 0.0,
|
| 274 |
+
"learning_rate": 1.3100000000000002e-05,
|
| 275 |
+
"loss": 12.216262054443359,
|
| 276 |
+
"step": 370
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"epoch": 95.0,
|
| 280 |
+
"grad_norm": 0.0,
|
| 281 |
+
"learning_rate": 1.2100000000000001e-05,
|
| 282 |
+
"loss": 12.216262054443359,
|
| 283 |
+
"step": 380
|
| 284 |
+
},
|
| 285 |
+
{
|
| 286 |
+
"epoch": 97.5,
|
| 287 |
+
"grad_norm": 0.0,
|
| 288 |
+
"learning_rate": 1.11e-05,
|
| 289 |
+
"loss": 12.216262054443359,
|
| 290 |
+
"step": 390
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"epoch": 100.0,
|
| 294 |
+
"grad_norm": 0.0,
|
| 295 |
+
"learning_rate": 1.0100000000000002e-05,
|
| 296 |
+
"loss": 12.216262054443359,
|
| 297 |
+
"step": 400
|
| 298 |
+
},
|
| 299 |
+
{
|
| 300 |
+
"epoch": 102.5,
|
| 301 |
+
"grad_norm": 0.0,
|
| 302 |
+
"learning_rate": 9.100000000000001e-06,
|
| 303 |
+
"loss": 12.216262054443359,
|
| 304 |
+
"step": 410
|
| 305 |
+
},
|
| 306 |
+
{
|
| 307 |
+
"epoch": 105.0,
|
| 308 |
+
"grad_norm": 0.0,
|
| 309 |
+
"learning_rate": 8.1e-06,
|
| 310 |
+
"loss": 12.216262054443359,
|
| 311 |
+
"step": 420
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"epoch": 107.5,
|
| 315 |
+
"grad_norm": 0.0,
|
| 316 |
+
"learning_rate": 7.1e-06,
|
| 317 |
+
"loss": 12.216262054443359,
|
| 318 |
+
"step": 430
|
| 319 |
+
},
|
| 320 |
+
{
|
| 321 |
+
"epoch": 110.0,
|
| 322 |
+
"grad_norm": 0.0,
|
| 323 |
+
"learning_rate": 6.1e-06,
|
| 324 |
+
"loss": 12.216262054443359,
|
| 325 |
+
"step": 440
|
| 326 |
+
},
|
| 327 |
+
{
|
| 328 |
+
"epoch": 112.5,
|
| 329 |
+
"grad_norm": 0.0,
|
| 330 |
+
"learning_rate": 5.1e-06,
|
| 331 |
+
"loss": 12.216262054443359,
|
| 332 |
+
"step": 450
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"epoch": 115.0,
|
| 336 |
+
"grad_norm": 0.0,
|
| 337 |
+
"learning_rate": 4.1000000000000006e-06,
|
| 338 |
+
"loss": 12.216262054443359,
|
| 339 |
+
"step": 460
|
| 340 |
+
},
|
| 341 |
+
{
|
| 342 |
+
"epoch": 117.5,
|
| 343 |
+
"grad_norm": 0.0,
|
| 344 |
+
"learning_rate": 3.1e-06,
|
| 345 |
+
"loss": 12.216262054443359,
|
| 346 |
+
"step": 470
|
| 347 |
+
},
|
| 348 |
+
{
|
| 349 |
+
"epoch": 120.0,
|
| 350 |
+
"grad_norm": 0.0,
|
| 351 |
+
"learning_rate": 2.1000000000000002e-06,
|
| 352 |
+
"loss": 12.216262054443359,
|
| 353 |
+
"step": 480
|
| 354 |
+
},
|
| 355 |
+
{
|
| 356 |
+
"epoch": 122.5,
|
| 357 |
+
"grad_norm": 0.0,
|
| 358 |
+
"learning_rate": 1.1e-06,
|
| 359 |
+
"loss": 12.216262054443359,
|
| 360 |
+
"step": 490
|
| 361 |
+
},
|
| 362 |
+
{
|
| 363 |
+
"epoch": 125.0,
|
| 364 |
+
"grad_norm": 0.0,
|
| 365 |
+
"learning_rate": 1.0000000000000001e-07,
|
| 366 |
+
"loss": 12.216262054443359,
|
| 367 |
+
"step": 500
|
| 368 |
+
}
|
| 369 |
+
],
|
| 370 |
+
"logging_steps": 10,
|
| 371 |
+
"max_steps": 500,
|
| 372 |
+
"num_input_tokens_seen": 0,
|
| 373 |
+
"num_train_epochs": 125,
|
| 374 |
+
"save_steps": 500,
|
| 375 |
+
"stateful_callbacks": {
|
| 376 |
+
"TrainerControl": {
|
| 377 |
+
"args": {
|
| 378 |
+
"should_epoch_stop": false,
|
| 379 |
+
"should_evaluate": false,
|
| 380 |
+
"should_log": false,
|
| 381 |
+
"should_save": true,
|
| 382 |
+
"should_training_stop": true
|
| 383 |
+
},
|
| 384 |
+
"attributes": {}
|
| 385 |
+
}
|
| 386 |
+
},
|
| 387 |
+
"total_flos": 2013482975232000.0,
|
| 388 |
+
"train_batch_size": 1,
|
| 389 |
+
"trial_name": null,
|
| 390 |
+
"trial_params": null
|
| 391 |
+
}
|
checkpoint-500/training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5bc989356c0d6b41f61495cf20b7417c186211fe618bb03360462df9b72cb0fb
|
| 3 |
+
size 5201
|
config.json
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Llama4ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"boi_token_index": 200080,
|
| 6 |
+
"dtype": "float32",
|
| 7 |
+
"eoi_token_index": 200081,
|
| 8 |
+
"image_token_index": 200092,
|
| 9 |
+
"model_type": "llama4",
|
| 10 |
+
"text_config": {
|
| 11 |
+
"_attn_implementation_autoset": true,
|
| 12 |
+
"attention_bias": false,
|
| 13 |
+
"attention_chunk_size": 8192,
|
| 14 |
+
"attention_dropout": 0.0,
|
| 15 |
+
"attn_scale": 0.1,
|
| 16 |
+
"attn_temperature_tuning": true,
|
| 17 |
+
"bos_token_id": 200000,
|
| 18 |
+
"dtype": "float32",
|
| 19 |
+
"eos_token_id": [
|
| 20 |
+
200001,
|
| 21 |
+
200007,
|
| 22 |
+
200008
|
| 23 |
+
],
|
| 24 |
+
"floor_scale": 8192,
|
| 25 |
+
"for_llm_compressor": false,
|
| 26 |
+
"head_dim": 128,
|
| 27 |
+
"hidden_act": "silu",
|
| 28 |
+
"hidden_size": 2048,
|
| 29 |
+
"initializer_range": 0.02,
|
| 30 |
+
"interleave_moe_layer_step": 1,
|
| 31 |
+
"intermediate_size": 3072,
|
| 32 |
+
"intermediate_size_mlp": 6144,
|
| 33 |
+
"layer_types": [
|
| 34 |
+
"chunked_attention",
|
| 35 |
+
"chunked_attention",
|
| 36 |
+
"chunked_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"chunked_attention",
|
| 39 |
+
"chunked_attention",
|
| 40 |
+
"chunked_attention",
|
| 41 |
+
"full_attention"
|
| 42 |
+
],
|
| 43 |
+
"max_position_embeddings": 10485760,
|
| 44 |
+
"model_type": "llama4_text",
|
| 45 |
+
"moe_layers": [
|
| 46 |
+
0,
|
| 47 |
+
1,
|
| 48 |
+
2,
|
| 49 |
+
3,
|
| 50 |
+
4,
|
| 51 |
+
5,
|
| 52 |
+
6,
|
| 53 |
+
7
|
| 54 |
+
],
|
| 55 |
+
"no_rope_layer_interval": 4,
|
| 56 |
+
"no_rope_layers": [
|
| 57 |
+
1,
|
| 58 |
+
1,
|
| 59 |
+
1,
|
| 60 |
+
0,
|
| 61 |
+
1,
|
| 62 |
+
1,
|
| 63 |
+
1,
|
| 64 |
+
0
|
| 65 |
+
],
|
| 66 |
+
"num_attention_heads": 16,
|
| 67 |
+
"num_experts_per_tok": 1,
|
| 68 |
+
"num_hidden_layers": 8,
|
| 69 |
+
"num_key_value_heads": 4,
|
| 70 |
+
"num_local_experts": 4,
|
| 71 |
+
"output_router_logits": false,
|
| 72 |
+
"pad_token_id": 200018,
|
| 73 |
+
"rms_norm_eps": 1e-05,
|
| 74 |
+
"rope_parameters": {
|
| 75 |
+
"factor": 16.0,
|
| 76 |
+
"high_freq_factor": 1.0,
|
| 77 |
+
"low_freq_factor": 1.0,
|
| 78 |
+
"original_max_position_embeddings": 8192,
|
| 79 |
+
"rope_theta": 500000.0,
|
| 80 |
+
"rope_type": "llama3"
|
| 81 |
+
},
|
| 82 |
+
"router_aux_loss_coef": 0.001,
|
| 83 |
+
"router_jitter_noise": 0.0,
|
| 84 |
+
"tie_word_embeddings": false,
|
| 85 |
+
"use_cache": true,
|
| 86 |
+
"use_qk_norm": true,
|
| 87 |
+
"vocab_size": 202048
|
| 88 |
+
},
|
| 89 |
+
"tie_word_embeddings": false,
|
| 90 |
+
"transformers_version": "5.10.1",
|
| 91 |
+
"use_cache": false,
|
| 92 |
+
"vision_config": {
|
| 93 |
+
"_attn_implementation_autoset": true,
|
| 94 |
+
"attention_dropout": 0.0,
|
| 95 |
+
"dtype": "float32",
|
| 96 |
+
"hidden_act": "gelu",
|
| 97 |
+
"hidden_size": 768,
|
| 98 |
+
"image_size": 336,
|
| 99 |
+
"initializer_range": 0.02,
|
| 100 |
+
"intermediate_size": 3072,
|
| 101 |
+
"model_type": "llama4_vision_model",
|
| 102 |
+
"multi_modal_projector_bias": false,
|
| 103 |
+
"norm_eps": 1e-05,
|
| 104 |
+
"num_attention_heads": 12,
|
| 105 |
+
"num_channels": 3,
|
| 106 |
+
"num_hidden_layers": 6,
|
| 107 |
+
"patch_size": 14,
|
| 108 |
+
"pixel_shuffle_ratio": 0.5,
|
| 109 |
+
"projector_dropout": 0.0,
|
| 110 |
+
"projector_input_dim": 2048,
|
| 111 |
+
"projector_output_dim": 2048,
|
| 112 |
+
"rope_parameters": {
|
| 113 |
+
"rope_theta": 10000,
|
| 114 |
+
"rope_type": "default"
|
| 115 |
+
},
|
| 116 |
+
"vision_feature_layer": -1,
|
| 117 |
+
"vision_feature_select_strategy": "default",
|
| 118 |
+
"vision_output_dim": 2048
|
| 119 |
+
}
|
| 120 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 200000,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
200001,
|
| 6 |
+
200007,
|
| 7 |
+
200008
|
| 8 |
+
],
|
| 9 |
+
"output_attentions": false,
|
| 10 |
+
"output_hidden_states": false,
|
| 11 |
+
"pad_token_id": 200018,
|
| 12 |
+
"transformers_version": "5.10.1",
|
| 13 |
+
"use_cache": true
|
| 14 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:739252e404227a38b8f48330f3fa86169e7c162382cd134cb2743dda6b333ec3
|
| 3 |
+
size 6898648848
|
processor_config.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fake_image_token": "<|image|>",
|
| 3 |
+
"image_processor": {
|
| 4 |
+
"data_format": "channels_first",
|
| 5 |
+
"default_to_square": true,
|
| 6 |
+
"do_convert_rgb": true,
|
| 7 |
+
"do_normalize": true,
|
| 8 |
+
"do_rescale": true,
|
| 9 |
+
"do_resize": true,
|
| 10 |
+
"image_mean": [
|
| 11 |
+
0.5,
|
| 12 |
+
0.5,
|
| 13 |
+
0.5
|
| 14 |
+
],
|
| 15 |
+
"image_processor_type": "Llama4ImageProcessor",
|
| 16 |
+
"image_std": [
|
| 17 |
+
0.5,
|
| 18 |
+
0.5,
|
| 19 |
+
0.5
|
| 20 |
+
],
|
| 21 |
+
"max_patches": 16,
|
| 22 |
+
"resample": 2,
|
| 23 |
+
"rescale_factor": 0.00392156862745098,
|
| 24 |
+
"resize_to_max_canvas": false,
|
| 25 |
+
"size": {
|
| 26 |
+
"height": 336,
|
| 27 |
+
"width": 336
|
| 28 |
+
}
|
| 29 |
+
},
|
| 30 |
+
"image_token": "<|image|>",
|
| 31 |
+
"patch_size": 14,
|
| 32 |
+
"processor_class": "Llama4Processor"
|
| 33 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f32e154d2e27a25934998e1500e6e6504ef0572ca67d28be95c29d923fd5e6b0
|
| 3 |
+
size 27948865
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backend": "tokenizers",
|
| 3 |
+
"bos_token": "<|begin_of_text|>",
|
| 4 |
+
"clean_up_tokenization_spaces": false,
|
| 5 |
+
"eos_token": "<|eot|>",
|
| 6 |
+
"is_local": true,
|
| 7 |
+
"local_files_only": false,
|
| 8 |
+
"model_input_names": [
|
| 9 |
+
"input_ids",
|
| 10 |
+
"attention_mask"
|
| 11 |
+
],
|
| 12 |
+
"model_max_length": 10485760,
|
| 13 |
+
"pad_token": "<|finetune_right_pad|>",
|
| 14 |
+
"processor_class": "Llama4Processor",
|
| 15 |
+
"tokenizer_class": "TokenizersBackend"
|
| 16 |
+
}
|
training_args.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5bc989356c0d6b41f61495cf20b7417c186211fe618bb03360462df9b72cb0fb
|
| 3 |
+
size 5201
|