初始化项目,由ModelHub XC社区提供模型
Model: squ11z1/claude-oss-350m Source: Original Platform
This commit is contained in:
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
*.gguf filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
language:
|
||||
- en
|
||||
tags:
|
||||
- text-generation
|
||||
- claude
|
||||
- lfm2
|
||||
- claude-style
|
||||
- gguf
|
||||
base_model:
|
||||
- LiquidAI/LFM2.5-350M
|
||||
base_model_relation: finetune
|
||||
library_name: transformers
|
||||
pipeline_tag: text-generation
|
||||
license: other
|
||||
---
|
||||
|
||||
# Claude OSS 350M
|
||||
|
||||
> **Disclaimer:** This is **not** an official release by Anthropic.
|
||||
> Claude OSS 350M is an independent open model project.
|
||||
|
||||

|
||||
|
||||
## Overview
|
||||
|
||||
Claude OSS 350M is a compact assistant model built to bring a **familiar Claude-style feel into an edge-sized model**.
|
||||
|
||||
In simple terms: this is an attempt to capture the **habitual Claude-style tone and interaction pattern in a lightweight 350M-class model** that is easier to run in constrained environments.
|
||||
|
||||
The model was fine-tuned on **open-source datasets**, with a combined total of approximately **200,000 rows** collected from Hugging Face. The training focus emphasized assistant behavior, conversational tone, instruction following, and consistent identity in a small-footprint setting.
|
||||
|
||||
Claude OSS 350M is intended for:
|
||||
|
||||
- edge deployment
|
||||
- low-memory experimentation
|
||||
- lightweight assistant tasks
|
||||
- fast local inference
|
||||
- compact multilingual interaction
|
||||
|
||||
---
|
||||
64
chat_template.jinja
Normal file
64
chat_template.jinja
Normal file
@@ -0,0 +1,64 @@
|
||||
{{- bos_token -}}
|
||||
{%- set keep_past_thinking = keep_past_thinking | default(false) -%}
|
||||
{%- set ns = namespace(system_prompt="") -%}
|
||||
{%- if messages[0]["role"] == "system" -%}
|
||||
{%- set sys_content = messages[0]["content"] -%}
|
||||
{%- if sys_content is not string -%}
|
||||
{%- for item in sys_content -%}
|
||||
{%- if item["type"] == "text" -%}
|
||||
{%- set ns.system_prompt = ns.system_prompt + item["text"] -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- else -%}
|
||||
{%- set ns.system_prompt = sys_content -%}
|
||||
{%- endif -%}
|
||||
{%- set messages = messages[1:] -%}
|
||||
{%- endif -%}
|
||||
{%- if tools -%}
|
||||
{%- set ns.system_prompt = ns.system_prompt + ("\n" if ns.system_prompt else "") + "List of tools: [" -%}
|
||||
{%- for tool in tools -%}
|
||||
{%- if tool is not string -%}
|
||||
{%- set tool = tool | tojson -%}
|
||||
{%- endif -%}
|
||||
{%- set ns.system_prompt = ns.system_prompt + tool -%}
|
||||
{%- if not loop.last -%}
|
||||
{%- set ns.system_prompt = ns.system_prompt + ", " -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- set ns.system_prompt = ns.system_prompt + "]" -%}
|
||||
{%- endif -%}
|
||||
{%- if ns.system_prompt -%}
|
||||
{{- "<|im_start|>system\n" + ns.system_prompt + "<|im_end|>\n" -}}
|
||||
{%- endif -%}
|
||||
{%- set ns.last_assistant_index = -1 -%}
|
||||
{%- for message in messages -%}
|
||||
{%- if message["role"] == "assistant" -%}
|
||||
{%- set ns.last_assistant_index = loop.index0 -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- for message in messages -%}
|
||||
{{- "<|im_start|>" + message["role"] + "\n" -}}
|
||||
{%- set content = message["content"] -%}
|
||||
{%- if content is not string -%}
|
||||
{%- set ns.content = "" -%}
|
||||
{%- for item in content -%}
|
||||
{%- if item["type"] == "image" -%}
|
||||
{%- set ns.content = ns.content + "<image>" -%}
|
||||
{%- elif item["type"] == "text" -%}
|
||||
{%- set ns.content = ns.content + item["text"] -%}
|
||||
{%- else -%}
|
||||
{%- set ns.content = ns.content + item | tojson -%}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
{%- set content = ns.content -%}
|
||||
{%- endif -%}
|
||||
{%- if message["role"] == "assistant" and not keep_past_thinking and loop.index0 != ns.last_assistant_index -%}
|
||||
{%- if "</think>" in content -%}
|
||||
{%- set content = content.split("</think>")[-1] | trim -%}
|
||||
{%- endif -%}
|
||||
{%- endif -%}
|
||||
{{- content + "<|im_end|>\n" -}}
|
||||
{%- endfor -%}
|
||||
{%- if add_generation_prompt -%}
|
||||
{{- "<|im_start|>assistant\n" -}}
|
||||
{%- endif -%}
|
||||
60
config.json
Normal file
60
config.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"architectures": [
|
||||
"Lfm2ForCausalLM"
|
||||
],
|
||||
"block_auto_adjust_ff_dim": true,
|
||||
"block_dim": 1024,
|
||||
"block_ff_dim": 6656,
|
||||
"block_ffn_dim_multiplier": 1.0,
|
||||
"block_mlp_init_scale": 1.0,
|
||||
"block_multiple_of": 256,
|
||||
"block_norm_eps": 1e-05,
|
||||
"block_out_init_scale": 1.0,
|
||||
"block_use_swiglu": true,
|
||||
"block_use_xavier_init": true,
|
||||
"bos_token_id": 1,
|
||||
"conv_L_cache": 3,
|
||||
"conv_bias": false,
|
||||
"conv_dim": 1024,
|
||||
"conv_use_xavier_init": true,
|
||||
"dtype": "float32",
|
||||
"eos_token_id": 7,
|
||||
"hidden_size": 1024,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 6656,
|
||||
"layer_types": [
|
||||
"conv",
|
||||
"conv",
|
||||
"full_attention",
|
||||
"conv",
|
||||
"conv",
|
||||
"full_attention",
|
||||
"conv",
|
||||
"conv",
|
||||
"full_attention",
|
||||
"conv",
|
||||
"full_attention",
|
||||
"conv",
|
||||
"full_attention",
|
||||
"conv",
|
||||
"full_attention",
|
||||
"conv"
|
||||
],
|
||||
"max_position_embeddings": 128000,
|
||||
"model_type": "lfm2",
|
||||
"norm_eps": 1e-05,
|
||||
"num_attention_heads": 16,
|
||||
"num_heads": 16,
|
||||
"num_hidden_layers": 16,
|
||||
"num_key_value_heads": 8,
|
||||
"pad_token_id": 0,
|
||||
"rope_parameters": {
|
||||
"rope_theta": 1000000.0,
|
||||
"rope_type": "default"
|
||||
},
|
||||
"tie_embedding": true,
|
||||
"transformers_version": "5.0.0rc1",
|
||||
"use_cache": true,
|
||||
"use_pos_enc": true,
|
||||
"vocab_size": 65536
|
||||
}
|
||||
7
generation_config.json
Normal file
7
generation_config.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": 7,
|
||||
"pad_token_id": 0,
|
||||
"transformers_version": "5.0.0rc1"
|
||||
}
|
||||
3
gguf/claude-oss-350m-q4_k_m.gguf
Normal file
3
gguf/claude-oss-350m-q4_k_m.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:04474fd297adea3be44716a9e5215f7e256d683321360a1d3470afb6878dacce
|
||||
size 229311520
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:138766bc514808920ab3791f181c109a3ed46e9a39dedaa8f7ad1ef5b6cf2a8d
|
||||
size 1417952352
|
||||
323830
tokenizer.json
Normal file
323830
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
22
tokenizer_config.json
Normal file
22
tokenizer_config.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"additional_special_tokens": null,
|
||||
"backend": "tokenizers",
|
||||
"bos_token": "<|startoftext|>",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "<|im_end|>",
|
||||
"extra_special_tokens": [],
|
||||
"is_local": false,
|
||||
"legacy": false,
|
||||
"model_input_names": [
|
||||
"input_ids",
|
||||
"attention_mask"
|
||||
],
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"model_specific_special_tokens": {},
|
||||
"pad_token": "<|pad|>",
|
||||
"sp_model_kwargs": {},
|
||||
"spaces_between_special_tokens": false,
|
||||
"tokenizer_class": "TokenizersBackend",
|
||||
"use_default_system_prompt": false,
|
||||
"use_fast": true
|
||||
}
|
||||
10
training_metrics.json
Normal file
10
training_metrics.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"base_model": "LiquidAI/LFM2.5-350M",
|
||||
"epochs": 1,
|
||||
"train_loss": 1.1604940860100041,
|
||||
"valid_loss": 0.764136791229248,
|
||||
"test_loss": 0.7036402225494385,
|
||||
"train_runtime_seconds": 10108.6333,
|
||||
"valid_runtime_seconds": 44.5711,
|
||||
"test_runtime_seconds": 37.9638
|
||||
}
|
||||
Reference in New Issue
Block a user