Text Generation
Transformers
Safetensors
PyTorch
English
graph_token_lm
causal-lm
graph-neural-network
graph-to-text
graph-conditioned-generation
multimodal
custom-code
qwen
conversational
custom_code
Instructions to use naos-ku/GraphTokenLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use naos-ku/GraphTokenLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="naos-ku/GraphTokenLM", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("naos-ku/GraphTokenLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use naos-ku/GraphTokenLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "naos-ku/GraphTokenLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "naos-ku/GraphTokenLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/naos-ku/GraphTokenLM
- SGLang
How to use naos-ku/GraphTokenLM 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 "naos-ku/GraphTokenLM" \ --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": "naos-ku/GraphTokenLM", "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 "naos-ku/GraphTokenLM" \ --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": "naos-ku/GraphTokenLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use naos-ku/GraphTokenLM with Docker Model Runner:
docker model run hf.co/naos-ku/GraphTokenLM
Export GraphTokenLM to Hugging Face Hub
Browse files- .gitattributes +1 -0
- added_tokens.json +28 -0
- chat_template.jinja +85 -0
- config.json +39 -0
- generation_config.json +8 -0
- glm.py +553 -0
- merges.txt +0 -0
- model-00001-of-00004.safetensors +3 -0
- model-00002-of-00004.safetensors +3 -0
- model-00003-of-00004.safetensors +3 -0
- model-00004-of-00004.safetensors +3 -0
- model.safetensors.index.json +421 -0
- requirements.txt +5 -0
- special_tokens_map.json +31 -0
- tokenizer.json +3 -0
- tokenizer_config.json +239 -0
- vocab.json +0 -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
|
added_tokens.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"</think>": 151668,
|
| 3 |
+
"</tool_call>": 151658,
|
| 4 |
+
"</tool_response>": 151666,
|
| 5 |
+
"<think>": 151667,
|
| 6 |
+
"<tool_call>": 151657,
|
| 7 |
+
"<tool_response>": 151665,
|
| 8 |
+
"<|box_end|>": 151649,
|
| 9 |
+
"<|box_start|>": 151648,
|
| 10 |
+
"<|endoftext|>": 151643,
|
| 11 |
+
"<|file_sep|>": 151664,
|
| 12 |
+
"<|fim_middle|>": 151660,
|
| 13 |
+
"<|fim_pad|>": 151662,
|
| 14 |
+
"<|fim_prefix|>": 151659,
|
| 15 |
+
"<|fim_suffix|>": 151661,
|
| 16 |
+
"<|im_end|>": 151645,
|
| 17 |
+
"<|im_start|>": 151644,
|
| 18 |
+
"<|image_pad|>": 151655,
|
| 19 |
+
"<|object_ref_end|>": 151647,
|
| 20 |
+
"<|object_ref_start|>": 151646,
|
| 21 |
+
"<|quad_end|>": 151651,
|
| 22 |
+
"<|quad_start|>": 151650,
|
| 23 |
+
"<|repo_name|>": 151663,
|
| 24 |
+
"<|video_pad|>": 151656,
|
| 25 |
+
"<|vision_end|>": 151653,
|
| 26 |
+
"<|vision_pad|>": 151654,
|
| 27 |
+
"<|vision_start|>": 151652
|
| 28 |
+
}
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\n</tools>\n\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call><|im_end|>\n" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
+
{%- for message in messages %}
|
| 26 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 27 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 28 |
+
{%- elif message.role == "assistant" %}
|
| 29 |
+
{%- set content = message.content %}
|
| 30 |
+
{%- set reasoning_content = '' %}
|
| 31 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 32 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 33 |
+
{%- else %}
|
| 34 |
+
{%- if '</think>' in message.content %}
|
| 35 |
+
{%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
|
| 36 |
+
{%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 37 |
+
{%- endif %}
|
| 38 |
+
{%- endif %}
|
| 39 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 40 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 41 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 42 |
+
{%- else %}
|
| 43 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- else %}
|
| 46 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- if message.tool_calls %}
|
| 49 |
+
{%- for tool_call in message.tool_calls %}
|
| 50 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 51 |
+
{{- '\n' }}
|
| 52 |
+
{%- endif %}
|
| 53 |
+
{%- if tool_call.function %}
|
| 54 |
+
{%- set tool_call = tool_call.function %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 57 |
+
{{- tool_call.name }}
|
| 58 |
+
{{- '", "arguments": ' }}
|
| 59 |
+
{%- if tool_call.arguments is string %}
|
| 60 |
+
{{- tool_call.arguments }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{{- tool_call.arguments | tojson }}
|
| 63 |
+
{%- endif %}
|
| 64 |
+
{{- '}\n</tool_call>' }}
|
| 65 |
+
{%- endfor %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{{- '<|im_end|>\n' }}
|
| 68 |
+
{%- elif message.role == "tool" %}
|
| 69 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 70 |
+
{{- '<|im_start|>user' }}
|
| 71 |
+
{%- endif %}
|
| 72 |
+
{{- '\n<tool_response>\n' }}
|
| 73 |
+
{{- message.content }}
|
| 74 |
+
{{- '\n</tool_response>' }}
|
| 75 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 76 |
+
{{- '<|im_end|>\n' }}
|
| 77 |
+
{%- endif %}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
{%- endfor %}
|
| 80 |
+
{%- if add_generation_prompt %}
|
| 81 |
+
{{- '<|im_start|>assistant\n' }}
|
| 82 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 83 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
{%- endif %}
|
config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"GraphTokenLM"
|
| 4 |
+
],
|
| 5 |
+
"base_model": "Qwen/Qwen3-4B-Base",
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"dtype": "float32",
|
| 8 |
+
"enable_lora": false,
|
| 9 |
+
"eos_token_id": 151643,
|
| 10 |
+
"freeze_llm": true,
|
| 11 |
+
"gnn_hidden": 64,
|
| 12 |
+
"gnn_hidden_dim": 64,
|
| 13 |
+
"gnn_out": 64,
|
| 14 |
+
"gnn_out_dim": 64,
|
| 15 |
+
"gnn_type": "GIN",
|
| 16 |
+
"graph_pooling": [
|
| 17 |
+
"mean"
|
| 18 |
+
],
|
| 19 |
+
"hidden_size": 2560,
|
| 20 |
+
"llm_name": "Qwen/Qwen3-4B-Base",
|
| 21 |
+
"lpe_dim": 8,
|
| 22 |
+
"model_type": "graph_token_lm",
|
| 23 |
+
"node_feat_dim": 8,
|
| 24 |
+
"node_pos_emb_dim": 8,
|
| 25 |
+
"num_attention_heads": 32,
|
| 26 |
+
"num_gnn_layers": 3,
|
| 27 |
+
"num_graph_tokens": 4,
|
| 28 |
+
"num_hidden_layers": 36,
|
| 29 |
+
"num_max_nodes": 20,
|
| 30 |
+
"num_proj_layers": 2,
|
| 31 |
+
"pos_emb_dim": 8,
|
| 32 |
+
"transformers_version": "4.57.1",
|
| 33 |
+
"use_degree_emb": false,
|
| 34 |
+
"vocab_size": 151936,
|
| 35 |
+
"auto_map": {
|
| 36 |
+
"AutoConfig": "glm.GraphTokenLMConfig",
|
| 37 |
+
"AutoModelForCausalLM": "glm.GraphTokenLM"
|
| 38 |
+
}
|
| 39 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"eos_token_id": [
|
| 4 |
+
151643
|
| 5 |
+
],
|
| 6 |
+
"pad_token_id": 151643,
|
| 7 |
+
"transformers_version": "4.57.1"
|
| 8 |
+
}
|
glm.py
ADDED
|
@@ -0,0 +1,553 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Literal
|
| 2 |
+
|
| 3 |
+
import torch
|
| 4 |
+
import torch.nn as nn
|
| 5 |
+
from torch_geometric.nn import (
|
| 6 |
+
GATConv,
|
| 7 |
+
GCNConv,
|
| 8 |
+
GINConv,
|
| 9 |
+
GraphSAGE,
|
| 10 |
+
TransformerConv,
|
| 11 |
+
global_add_pool,
|
| 12 |
+
global_max_pool,
|
| 13 |
+
global_mean_pool,
|
| 14 |
+
)
|
| 15 |
+
from torch_geometric.utils import to_dense_batch
|
| 16 |
+
from transformers import (
|
| 17 |
+
AutoConfig,
|
| 18 |
+
AutoModelForCausalLM,
|
| 19 |
+
PretrainedConfig,
|
| 20 |
+
PreTrainedModel,
|
| 21 |
+
)
|
| 22 |
+
from transformers.generation.utils import GenerationMixin
|
| 23 |
+
from transformers.modeling_outputs import CausalLMOutputWithPast
|
| 24 |
+
|
| 25 |
+
VALID_GRAPH_POOLING = ["mean", "sum", "max"]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class GraphTokenLMConfig(PretrainedConfig):
|
| 29 |
+
model_type = "graph_token_lm"
|
| 30 |
+
|
| 31 |
+
def __init__(
|
| 32 |
+
self,
|
| 33 |
+
base_model="Qwen/Qwen3-4B-Base",
|
| 34 |
+
gnn_type: Literal["GCN", "GAT", "GIN", "GraphSAGE", "GraphTransformer"] = "GCN",
|
| 35 |
+
node_feat_dim=8,
|
| 36 |
+
lpe_dim: int | None = None,
|
| 37 |
+
use_degree_emb: bool = False,
|
| 38 |
+
pos_emb_dim=8,
|
| 39 |
+
gnn_hidden_dim=256,
|
| 40 |
+
gnn_out_dim=512,
|
| 41 |
+
num_gnn_layers=2,
|
| 42 |
+
graph_pooling: list[Literal["mean", "sum", "max"]] = ["mean"],
|
| 43 |
+
num_proj_layers=1,
|
| 44 |
+
num_graph_tokens=4,
|
| 45 |
+
num_max_nodes=20, # maximum number of nodes per batch
|
| 46 |
+
freeze_llm=True,
|
| 47 |
+
enable_lora: bool = False,
|
| 48 |
+
tie_word_embeddings=True,
|
| 49 |
+
**kwargs,
|
| 50 |
+
):
|
| 51 |
+
"""Initialize a GraphToken language model configuration.
|
| 52 |
+
|
| 53 |
+
Parameters
|
| 54 |
+
----------
|
| 55 |
+
base_model : str, default="Qwen/Qwen3-4B-Base"
|
| 56 |
+
Hugging Face model name or path for the underlying LLM.
|
| 57 |
+
gnn_type : {"GCN", "GAT", "GIN", "GraphSAGE", "GraphTransformer"}, default="GCN"
|
| 58 |
+
Type of GNN layer to use for encoding graph nodes.
|
| 59 |
+
node_feat_dim : int, default=8
|
| 60 |
+
Dimensionality of the raw node features.
|
| 61 |
+
lpe_dim : int or None, default=None
|
| 62 |
+
Dimensionality for Laplacian positional encodings; defaults to ``node_feat_dim``.
|
| 63 |
+
use_degree_emb : bool, default=False
|
| 64 |
+
Whether to add degree-based embeddings to node features.
|
| 65 |
+
pos_emb_dim : int, default=8
|
| 66 |
+
Dimensionality of learned positional embeddings for nodes.
|
| 67 |
+
gnn_hidden_dim : int, default=256
|
| 68 |
+
Hidden dimensionality for the GNN stack.
|
| 69 |
+
gnn_out_dim : int, default=512
|
| 70 |
+
Output dimensionality of the GNN encoder.
|
| 71 |
+
num_gnn_layers : int, default=2
|
| 72 |
+
Number of GNN layers to apply.
|
| 73 |
+
num_proj_layers : int, default=1
|
| 74 |
+
Number of projection layers mapping graph reps to tokens.
|
| 75 |
+
num_graph_tokens : int, default=4
|
| 76 |
+
Number of graph tokens to prepend to the LLM.
|
| 77 |
+
num_max_nodes : int, default=20
|
| 78 |
+
Maximum number of nodes per graph in a batch.
|
| 79 |
+
graph_pooling : {"mean", "sum", "max"} list, default=["mean"]
|
| 80 |
+
Pooling strategy for graph-level aggregation. When multiple values are
|
| 81 |
+
provided, pooled vectors are concatenated.
|
| 82 |
+
freeze_llm : bool, default=True
|
| 83 |
+
Whether to freeze the underlying LLM parameters.
|
| 84 |
+
enable_lora : bool, default=False
|
| 85 |
+
Whether LoRA adapters are expected to be active, in which case the
|
| 86 |
+
base LLM should remain in training mode unless explicitly set
|
| 87 |
+
elsewhere.
|
| 88 |
+
tie_word_embeddings : bool, default=True
|
| 89 |
+
Whether to tie input/output embeddings in the LLM config.
|
| 90 |
+
**kwargs
|
| 91 |
+
Additional arguments forwarded to ``PretrainedConfig``.
|
| 92 |
+
"""
|
| 93 |
+
self.base_model = base_model
|
| 94 |
+
self.llm_name = base_model # backward compatibility
|
| 95 |
+
self.gnn_type = gnn_type
|
| 96 |
+
|
| 97 |
+
self.node_feat_dim = node_feat_dim
|
| 98 |
+
self.lpe_dim = lpe_dim if lpe_dim is not None else node_feat_dim
|
| 99 |
+
self.use_degree_emb = bool(use_degree_emb)
|
| 100 |
+
self.pos_emb_dim = pos_emb_dim
|
| 101 |
+
self.node_pos_emb_dim = pos_emb_dim # backward compatibility
|
| 102 |
+
self.gnn_hidden_dim = gnn_hidden_dim
|
| 103 |
+
self.gnn_hidden = gnn_hidden_dim # backward compatibility
|
| 104 |
+
self.gnn_out_dim = gnn_out_dim
|
| 105 |
+
self.gnn_out = gnn_out_dim # backward compatibility
|
| 106 |
+
self.num_gnn_layers = num_gnn_layers
|
| 107 |
+
self.num_proj_layers = num_proj_layers
|
| 108 |
+
self.num_graph_tokens = num_graph_tokens
|
| 109 |
+
self.num_max_nodes = num_max_nodes
|
| 110 |
+
self.graph_pooling = graph_pooling
|
| 111 |
+
self.freeze_llm = freeze_llm
|
| 112 |
+
self.enable_lora = enable_lora
|
| 113 |
+
|
| 114 |
+
# Keep generation-related fields for compatibility (updated later).
|
| 115 |
+
self.vocab_size = kwargs.get("vocab_size", None)
|
| 116 |
+
self.pad_token_id = kwargs.get("pad_token_id", None)
|
| 117 |
+
self.bos_token_id = kwargs.get("bos_token_id", None)
|
| 118 |
+
self.eos_token_id = kwargs.get("eos_token_id", None)
|
| 119 |
+
|
| 120 |
+
super().__init__(tie_word_embeddings=tie_word_embeddings, **kwargs)
|
| 121 |
+
|
| 122 |
+
# Maintain compatibility with transformers.GenerationConfig.
|
| 123 |
+
def get_text_config(self, decoder: bool | None = None, **kwargs):
|
| 124 |
+
return self
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
class GNNEncoder(nn.Module):
|
| 128 |
+
|
| 129 |
+
def __init__(
|
| 130 |
+
self,
|
| 131 |
+
in_dim: int,
|
| 132 |
+
hid_dim: int,
|
| 133 |
+
out_dim: int,
|
| 134 |
+
max_nodes: int,
|
| 135 |
+
num_layers: int = 2,
|
| 136 |
+
node_pos_emb_dim: int = 8,
|
| 137 |
+
dropout: float = 0.1,
|
| 138 |
+
gnn_type: Literal["GCN", "GAT", "GIN", "GraphSAGE", "GraphTransformer"] = "GCN",
|
| 139 |
+
):
|
| 140 |
+
"""Encode graph node features with a configurable GNN stack.
|
| 141 |
+
|
| 142 |
+
Parameters
|
| 143 |
+
----------
|
| 144 |
+
in_dim : int
|
| 145 |
+
Dimensionality of the input node features.
|
| 146 |
+
hid_dim : int
|
| 147 |
+
Hidden dimensionality used for intermediate layers.
|
| 148 |
+
out_dim : int
|
| 149 |
+
Dimensionality of the output node representations.
|
| 150 |
+
max_nodes : int
|
| 151 |
+
Maximum number of nodes per graph in a batch.
|
| 152 |
+
num_layers : int, default=2
|
| 153 |
+
Number of graph convolution layers.
|
| 154 |
+
node_pos_emb_dim : int, default=8
|
| 155 |
+
Dimensionality of the optional learned positional embeddings.
|
| 156 |
+
dropout : float, default=0.1
|
| 157 |
+
Dropout probability applied between hidden layers.
|
| 158 |
+
gnn_type : {"GCN", "GAT", "GIN", "GraphSAGE", "GraphTransformer"}, default="GCN"
|
| 159 |
+
Type of graph convolution layer to build.
|
| 160 |
+
"""
|
| 161 |
+
super().__init__()
|
| 162 |
+
self.max_nodes = max_nodes
|
| 163 |
+
self.pos_emb = nn.Embedding(max_nodes, node_pos_emb_dim) if node_pos_emb_dim > 0 else None
|
| 164 |
+
|
| 165 |
+
in_channels = in_dim + (node_pos_emb_dim if node_pos_emb_dim > 0 else 0)
|
| 166 |
+
if in_channels <= 0:
|
| 167 |
+
raise ValueError("GNNEncoder requires a positive input feature dimension.")
|
| 168 |
+
|
| 169 |
+
hidden_dims = [hid_dim] * max(num_layers - 1, 0)
|
| 170 |
+
dims = [in_channels, *hidden_dims, out_dim]
|
| 171 |
+
self.convs = nn.ModuleList()
|
| 172 |
+
for i in range(len(dims) - 1):
|
| 173 |
+
match gnn_type:
|
| 174 |
+
case "GCN":
|
| 175 |
+
self.convs.append(GCNConv(dims[i], dims[i + 1]))
|
| 176 |
+
case "GAT":
|
| 177 |
+
self.convs.append(GATConv(dims[i], dims[i + 1]))
|
| 178 |
+
case "GIN":
|
| 179 |
+
self.convs.append(GINConv(nn.Linear(dims[i], dims[i + 1])))
|
| 180 |
+
case "GraphSAGE":
|
| 181 |
+
self.convs.append(GraphSAGE(dims[i], dims[i + 1], 1))
|
| 182 |
+
case "GraphTransformer":
|
| 183 |
+
# Multi-head attention with concat disabled to keep the output dim aligned.
|
| 184 |
+
self.convs.append(TransformerConv(dims[i], dims[i + 1], heads=4, concat=False, dropout=dropout))
|
| 185 |
+
case _:
|
| 186 |
+
raise ValueError(f"Unsupported gnn_type: {gnn_type}")
|
| 187 |
+
self.act = nn.ReLU()
|
| 188 |
+
self.dropout = nn.Dropout(dropout)
|
| 189 |
+
|
| 190 |
+
def forward(self, x, edge_index, batch):
|
| 191 |
+
if self.pos_emb is not None:
|
| 192 |
+
# Assign positional indices per graph starting from zero within the batch.
|
| 193 |
+
_, mask = to_dense_batch(x, batch, max_num_nodes=self.max_nodes)
|
| 194 |
+
pos_idx = torch.arange(self.max_nodes, device=x.device).unsqueeze(0).expand(mask.size(0), -1)
|
| 195 |
+
pos_idx = pos_idx[mask]
|
| 196 |
+
x = torch.cat([x, self.pos_emb(pos_idx)], dim=-1)
|
| 197 |
+
for i, conv in enumerate(self.convs):
|
| 198 |
+
x = conv(x, edge_index)
|
| 199 |
+
if i < len(self.convs) - 1:
|
| 200 |
+
x = self.act(x)
|
| 201 |
+
x = self.dropout(x)
|
| 202 |
+
return x # [num_nodes, out_dim]
|
| 203 |
+
|
| 204 |
+
|
| 205 |
+
def _normalize_graph_pooling(graph_pooling: list[str]) -> list[str]:
|
| 206 |
+
"""Normalize and validate graph pooling values into a canonical list."""
|
| 207 |
+
poolings = list(graph_pooling)
|
| 208 |
+
if not (1 <= len(poolings) <= 3):
|
| 209 |
+
raise ValueError(f"Unsupported graph_pooling length: {len(poolings)}")
|
| 210 |
+
if len(set(poolings)) != len(poolings):
|
| 211 |
+
raise ValueError(f"Duplicate graph_pooling values: {poolings}")
|
| 212 |
+
if not set(poolings).issubset(set(VALID_GRAPH_POOLING)):
|
| 213 |
+
raise ValueError(f"Unsupported graph_pooling values: {poolings}")
|
| 214 |
+
return poolings
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
class DomainProjector(nn.Module):
|
| 218 |
+
|
| 219 |
+
def __init__(
|
| 220 |
+
self,
|
| 221 |
+
gnn_out_dim,
|
| 222 |
+
llm_hidden_size,
|
| 223 |
+
num_graph_tokens=4,
|
| 224 |
+
num_layers=1,
|
| 225 |
+
graph_pooling: list[str] = ["mean"],
|
| 226 |
+
):
|
| 227 |
+
"""Project graph-level representations into graph tokens.
|
| 228 |
+
|
| 229 |
+
The projector first pools node embeddings into a graph representation and
|
| 230 |
+
then maps it into ``k`` graph tokens that match the language model's hidden
|
| 231 |
+
dimension.
|
| 232 |
+
|
| 233 |
+
Parameters
|
| 234 |
+
----------
|
| 235 |
+
gnn_out_dim : int
|
| 236 |
+
Dimensionality of the encoder output to project from.
|
| 237 |
+
llm_hidden_size : int
|
| 238 |
+
Target dimensionality matching the language model embeddings.
|
| 239 |
+
num_graph_tokens : int, default=4
|
| 240 |
+
Number of graph tokens to produce.
|
| 241 |
+
graph_pooling : {"mean", "sum", "max"} list, default=["mean"]
|
| 242 |
+
Pooling strategy used to aggregate node embeddings. When multiple values are
|
| 243 |
+
provided, pooled vectors are concatenated.
|
| 244 |
+
num_layers : int, default=1
|
| 245 |
+
Number of linear/GELU projection layers.
|
| 246 |
+
"""
|
| 247 |
+
super().__init__()
|
| 248 |
+
if num_layers < 1:
|
| 249 |
+
raise ValueError("DomainProjector requires at least one projection layer.")
|
| 250 |
+
poolings = _normalize_graph_pooling(graph_pooling)
|
| 251 |
+
self.num_graph_tokens = num_graph_tokens
|
| 252 |
+
self.graph_pooling = poolings
|
| 253 |
+
layers = []
|
| 254 |
+
in_dim = gnn_out_dim * len(poolings)
|
| 255 |
+
final_dim = llm_hidden_size * num_graph_tokens
|
| 256 |
+
if num_layers == 1:
|
| 257 |
+
layer_dims = [final_dim]
|
| 258 |
+
else:
|
| 259 |
+
ratio = final_dim / in_dim
|
| 260 |
+
layer_dims = []
|
| 261 |
+
prev_dim = in_dim
|
| 262 |
+
for layer_idx in range(num_layers):
|
| 263 |
+
t = (layer_idx + 1) / num_layers
|
| 264 |
+
dim = max(1, int(round(in_dim * (ratio ** t))))
|
| 265 |
+
if dim % 2 != 0:
|
| 266 |
+
dim += 1
|
| 267 |
+
dim = max(dim, prev_dim)
|
| 268 |
+
layer_dims.append(dim)
|
| 269 |
+
prev_dim = dim
|
| 270 |
+
layer_dims[-1] = final_dim
|
| 271 |
+
for layer_idx, out_dim in enumerate(layer_dims):
|
| 272 |
+
layers.append(nn.Linear(in_dim, out_dim))
|
| 273 |
+
if layer_idx < num_layers - 1:
|
| 274 |
+
layers.append(nn.GELU())
|
| 275 |
+
in_dim = out_dim
|
| 276 |
+
self.project = nn.Sequential(*layers)
|
| 277 |
+
|
| 278 |
+
# Optional learned positional embeddings for graph tokens.
|
| 279 |
+
self.graph_pos = nn.Embedding(num_graph_tokens, llm_hidden_size)
|
| 280 |
+
|
| 281 |
+
def forward(self, node_repr, batch_index):
|
| 282 |
+
"""Aggregate node embeddings into graph tokens.
|
| 283 |
+
|
| 284 |
+
Parameters
|
| 285 |
+
----------
|
| 286 |
+
node_repr : torch.Tensor
|
| 287 |
+
Node representations of shape ``(num_nodes_total, gnn_out_dim)``.
|
| 288 |
+
batch_index : torch.Tensor
|
| 289 |
+
Batch indices identifying the graph for each node. Shape
|
| 290 |
+
``(num_nodes_total,)``.
|
| 291 |
+
|
| 292 |
+
Returns
|
| 293 |
+
-------
|
| 294 |
+
torch.Tensor
|
| 295 |
+
Graph token tensor of shape ``(batch_size, num_graph_tokens, hidden)``.
|
| 296 |
+
"""
|
| 297 |
+
# Pool node representations into a graph-level vector.
|
| 298 |
+
pooled_list = []
|
| 299 |
+
if "mean" in self.graph_pooling:
|
| 300 |
+
pooled_list.append(global_mean_pool(node_repr, batch_index)) # [B, gnn_out_dim]
|
| 301 |
+
if "sum" in self.graph_pooling:
|
| 302 |
+
pooled_list.append(global_add_pool(node_repr, batch_index)) # [B, gnn_out_dim]
|
| 303 |
+
if "max" in self.graph_pooling:
|
| 304 |
+
pooled_list.append(global_max_pool(node_repr, batch_index)) # [B, gnn_out_dim]
|
| 305 |
+
pooled = (
|
| 306 |
+
torch.cat(pooled_list, dim=-1) if len(pooled_list) > 1 else pooled_list[0]
|
| 307 |
+
) # [B, gnn_out_dim * num_poolings]
|
| 308 |
+
B = pooled.size(0)
|
| 309 |
+
|
| 310 |
+
# Expand into k tokens via the projection stack.
|
| 311 |
+
tokens = self.project(pooled) # [B, k * hidden]
|
| 312 |
+
Hk = tokens.view(B, self.num_graph_tokens, -1) # [B, k, hidden]
|
| 313 |
+
|
| 314 |
+
# Add learned positional embeddings.
|
| 315 |
+
pos = self.graph_pos.weight.unsqueeze(0).expand(B, -1, -1) # [B, k, hidden]
|
| 316 |
+
Hk = Hk + pos
|
| 317 |
+
return Hk # [B, k, hidden]
|
| 318 |
+
|
| 319 |
+
|
| 320 |
+
class GraphTokenLM(PreTrainedModel, GenerationMixin):
|
| 321 |
+
"""Language model that prepends graph tokens to textual inputs.
|
| 322 |
+
|
| 323 |
+
A graph neural network encodes node features, pools them, and projects the
|
| 324 |
+
result into learned graph tokens that are concatenated with language model
|
| 325 |
+
embeddings before decoding.
|
| 326 |
+
|
| 327 |
+
Parameters
|
| 328 |
+
----------
|
| 329 |
+
config : GraphTokenLMConfig
|
| 330 |
+
Model configuration describing the graph encoder and base LLM.
|
| 331 |
+
load_llm_weights : bool, default=True
|
| 332 |
+
Whether to load pretrained weights for the base language model.
|
| 333 |
+
"""
|
| 334 |
+
|
| 335 |
+
_tied_weights_keys = ["llm.lm_head.weight"]
|
| 336 |
+
_keys_to_ignore_on_load_missing = [r"^llm\.lm_head\.weight$"]
|
| 337 |
+
|
| 338 |
+
config_class = GraphTokenLMConfig
|
| 339 |
+
base_model_prefix = "llm"
|
| 340 |
+
|
| 341 |
+
def __init__(self, config: GraphTokenLMConfig, load_llm_weights: bool = True):
|
| 342 |
+
|
| 343 |
+
super().__init__(config)
|
| 344 |
+
|
| 345 |
+
# LLM
|
| 346 |
+
if load_llm_weights:
|
| 347 |
+
self.llm = AutoModelForCausalLM.from_pretrained(
|
| 348 |
+
config.base_model, trust_remote_code=True, tie_word_embeddings=True
|
| 349 |
+
)
|
| 350 |
+
else:
|
| 351 |
+
llm_cfg = AutoConfig.from_pretrained(config.base_model, dtype=torch.float32)
|
| 352 |
+
self.llm = AutoModelForCausalLM.from_config(llm_cfg)
|
| 353 |
+
|
| 354 |
+
self.num_graph_tokens = config.num_graph_tokens
|
| 355 |
+
|
| 356 |
+
# GNN + Domain Projector
|
| 357 |
+
self.gnn = GNNEncoder(
|
| 358 |
+
gnn_type=config.gnn_type,
|
| 359 |
+
node_pos_emb_dim=config.pos_emb_dim,
|
| 360 |
+
in_dim=config.node_feat_dim,
|
| 361 |
+
hid_dim=config.gnn_hidden_dim,
|
| 362 |
+
out_dim=config.gnn_out_dim,
|
| 363 |
+
num_layers=config.num_gnn_layers,
|
| 364 |
+
max_nodes=config.num_max_nodes,
|
| 365 |
+
)
|
| 366 |
+
self.tokenizer_head = DomainProjector(
|
| 367 |
+
gnn_out_dim=config.gnn_out_dim,
|
| 368 |
+
llm_hidden_size=self.llm.config.hidden_size,
|
| 369 |
+
num_graph_tokens=config.num_graph_tokens,
|
| 370 |
+
num_layers=config.num_proj_layers,
|
| 371 |
+
graph_pooling=config.graph_pooling,
|
| 372 |
+
)
|
| 373 |
+
|
| 374 |
+
if config.freeze_llm:
|
| 375 |
+
for p in self.llm.parameters():
|
| 376 |
+
p.requires_grad = False
|
| 377 |
+
if not config.enable_lora:
|
| 378 |
+
self.llm.eval()
|
| 379 |
+
|
| 380 |
+
# --- sync basic generation fields so GenerationMixin works cleanly ---
|
| 381 |
+
mirror_keys = [
|
| 382 |
+
"vocab_size",
|
| 383 |
+
"pad_token_id",
|
| 384 |
+
"bos_token_id",
|
| 385 |
+
"eos_token_id",
|
| 386 |
+
"hidden_size",
|
| 387 |
+
"num_hidden_layers",
|
| 388 |
+
"num_attention_heads",
|
| 389 |
+
]
|
| 390 |
+
for k in mirror_keys:
|
| 391 |
+
if hasattr(self.llm.config, k):
|
| 392 |
+
setattr(self.config, k, getattr(self.llm.config, k))
|
| 393 |
+
|
| 394 |
+
# make sure tying is done once at init (harmless if already tied)
|
| 395 |
+
if getattr(self.config, "tie_word_embeddings", False):
|
| 396 |
+
self.tie_weights()
|
| 397 |
+
|
| 398 |
+
@property
|
| 399 |
+
def device(self):
|
| 400 |
+
return next(self.parameters()).device
|
| 401 |
+
|
| 402 |
+
def _concat_graph_tokens(
|
| 403 |
+
self,
|
| 404 |
+
input_ids=None,
|
| 405 |
+
attention_mask=None,
|
| 406 |
+
labels=None,
|
| 407 |
+
inputs_embeds=None,
|
| 408 |
+
graph=None,
|
| 409 |
+
):
|
| 410 |
+
"""Prepend graph tokens to language model embeddings.
|
| 411 |
+
|
| 412 |
+
Parameters
|
| 413 |
+
----------
|
| 414 |
+
input_ids : torch.Tensor, optional
|
| 415 |
+
Token IDs used to derive embeddings if ``inputs_embeds`` is not provided.
|
| 416 |
+
attention_mask : torch.Tensor, optional
|
| 417 |
+
Attention mask aligned with ``input_ids``.
|
| 418 |
+
labels : torch.Tensor, optional
|
| 419 |
+
Label tensor passed through unchanged.
|
| 420 |
+
inputs_embeds : torch.Tensor, optional
|
| 421 |
+
Precomputed language model embeddings.
|
| 422 |
+
graph : Mapping[str, torch.Tensor], optional
|
| 423 |
+
Graph structure containing ``x``, ``edge_index``, and ``batch`` as
|
| 424 |
+
produced by the collator.
|
| 425 |
+
|
| 426 |
+
Returns
|
| 427 |
+
-------
|
| 428 |
+
tuple of torch.Tensor
|
| 429 |
+
Tuple ``(inputs_embeds, attention_mask, labels)`` with graph tokens
|
| 430 |
+
concatenated at the front of the sequence.
|
| 431 |
+
"""
|
| 432 |
+
# Obtain embeddings from the base language model if necessary.
|
| 433 |
+
if inputs_embeds is None:
|
| 434 |
+
inputs_embeds = self.llm.get_input_embeddings()(input_ids)
|
| 435 |
+
|
| 436 |
+
B, T, H = inputs_embeds.size()
|
| 437 |
+
|
| 438 |
+
# ---- Graph to tokens ----
|
| 439 |
+
graph_device = next(self.gnn.parameters()).device
|
| 440 |
+
if hasattr(graph, "to"):
|
| 441 |
+
graph = graph.to(graph_device)
|
| 442 |
+
|
| 443 |
+
x = graph["x"] # [N_nodes, node_feat_dim]
|
| 444 |
+
edge_index = graph["edge_index"] # [2, N_edges]
|
| 445 |
+
batch = graph["batch"] # [N_nodes]
|
| 446 |
+
node_repr = self.gnn(x, edge_index, batch) # [N_nodes, gnn_out]
|
| 447 |
+
graph_tokens = self.tokenizer_head(node_repr, batch) # [B, k, H]
|
| 448 |
+
if inputs_embeds is not None:
|
| 449 |
+
graph_tokens = graph_tokens.to(inputs_embeds.device)
|
| 450 |
+
|
| 451 |
+
# ---- Concatenate by prepending graph tokens ----
|
| 452 |
+
new_inputs = torch.cat([graph_tokens, inputs_embeds], dim=1) # [B, k+T, H]
|
| 453 |
+
|
| 454 |
+
# Prepend ones to the attention mask for the graph tokens.
|
| 455 |
+
if attention_mask is None:
|
| 456 |
+
attention_mask = input_ids.ne(self.llm.config.pad_token_id).long()
|
| 457 |
+
new_attention = torch.cat(
|
| 458 |
+
[torch.ones((B, self.num_graph_tokens), dtype=attention_mask.dtype, device=self.device), attention_mask],
|
| 459 |
+
dim=1,
|
| 460 |
+
)
|
| 461 |
+
|
| 462 |
+
return new_inputs, new_attention, labels
|
| 463 |
+
|
| 464 |
+
def forward(
|
| 465 |
+
self,
|
| 466 |
+
input_ids=None,
|
| 467 |
+
attention_mask=None,
|
| 468 |
+
inputs_embeds=None,
|
| 469 |
+
graph=None,
|
| 470 |
+
labels=None,
|
| 471 |
+
**generate_kwargs,
|
| 472 |
+
) -> CausalLMOutputWithPast:
|
| 473 |
+
if (input_ids is None) and (inputs_embeds is None):
|
| 474 |
+
raise ValueError("Either input_ids or inputs_embeds must be provided")
|
| 475 |
+
|
| 476 |
+
if graph is not None:
|
| 477 |
+
inputs_embeds, attention_mask, labels = self._concat_graph_tokens(
|
| 478 |
+
input_ids=input_ids,
|
| 479 |
+
attention_mask=attention_mask,
|
| 480 |
+
labels=labels,
|
| 481 |
+
inputs_embeds=inputs_embeds,
|
| 482 |
+
graph=graph,
|
| 483 |
+
)
|
| 484 |
+
else:
|
| 485 |
+
# For generation, inputs may already include concatenated graph tokens.
|
| 486 |
+
if inputs_embeds is None:
|
| 487 |
+
inputs_embeds = self.llm.get_input_embeddings()(input_ids)
|
| 488 |
+
if attention_mask is None:
|
| 489 |
+
if input_ids is None:
|
| 490 |
+
raise ValueError("When attention_mask is not provided, input_ids must also be provided")
|
| 491 |
+
attention_mask = input_ids.ne(self.llm.config.pad_token_id).long()
|
| 492 |
+
|
| 493 |
+
# Exclude auxiliary keys that may interfere with Qwen3 loss computation.
|
| 494 |
+
blocked = {
|
| 495 |
+
"num_items_in_batch",
|
| 496 |
+
"label_smoothing", # Added by TRL/transformers in some setups.
|
| 497 |
+
"labels_shifted", # Same as above.
|
| 498 |
+
}
|
| 499 |
+
passdown = {
|
| 500 |
+
k: v
|
| 501 |
+
for k, v in generate_kwargs.items()
|
| 502 |
+
if k not in blocked and k in {"use_cache", "output_attentions", "output_hidden_states", "past_key_values"}
|
| 503 |
+
}
|
| 504 |
+
|
| 505 |
+
out = self.llm(
|
| 506 |
+
inputs_embeds=inputs_embeds,
|
| 507 |
+
attention_mask=attention_mask,
|
| 508 |
+
labels=labels,
|
| 509 |
+
**passdown,
|
| 510 |
+
)
|
| 511 |
+
return out
|
| 512 |
+
|
| 513 |
+
def prepare_inputs_for_generation(
|
| 514 |
+
self, input_ids=None, inputs_embeds=None, attention_mask=None, graph=None, **kwargs
|
| 515 |
+
):
|
| 516 |
+
if input_ids is None and inputs_embeds is None:
|
| 517 |
+
raise ValueError("Either input_ids or inputs_embeds must be provided")
|
| 518 |
+
if input_ids is not None and inputs_embeds is not None:
|
| 519 |
+
raise ValueError("Both input_ids and inputs_embeds cannot be provided at the same time")
|
| 520 |
+
|
| 521 |
+
if inputs_embeds is None:
|
| 522 |
+
inputs_embeds = self.llm.get_input_embeddings()(input_ids)
|
| 523 |
+
if graph is not None:
|
| 524 |
+
inputs_embeds, attention_mask, _ = self._concat_graph_tokens(
|
| 525 |
+
input_ids=None,
|
| 526 |
+
attention_mask=attention_mask,
|
| 527 |
+
labels=None,
|
| 528 |
+
inputs_embeds=inputs_embeds,
|
| 529 |
+
graph=graph,
|
| 530 |
+
)
|
| 531 |
+
|
| 532 |
+
return {"inputs_embeds": inputs_embeds, "attention_mask": attention_mask, "graph": None}
|
| 533 |
+
|
| 534 |
+
# delegate embeddings to inner LLM so HF can tie weights correctly
|
| 535 |
+
def get_input_embeddings(self):
|
| 536 |
+
return self.llm.get_input_embeddings()
|
| 537 |
+
|
| 538 |
+
def set_input_embeddings(self, new_embeddings):
|
| 539 |
+
self.llm.set_input_embeddings(new_embeddings)
|
| 540 |
+
|
| 541 |
+
def get_output_embeddings(self):
|
| 542 |
+
return self.llm.get_output_embeddings()
|
| 543 |
+
|
| 544 |
+
def set_output_embeddings(self, new_embeddings):
|
| 545 |
+
self.llm.set_output_embeddings(new_embeddings)
|
| 546 |
+
|
| 547 |
+
def tie_weights(self):
|
| 548 |
+
# honor config.tie_word_embeddings and delegate
|
| 549 |
+
if getattr(self.config, "tie_word_embeddings", False):
|
| 550 |
+
# inner LLM handles actual tying (lm_head <-> embeddings)
|
| 551 |
+
self.llm.tie_weights()
|
| 552 |
+
# keep parent behavior (no-op for most models)
|
| 553 |
+
return super().tie_weights()
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3650ff7c5d121c035778ff7f6999694c9e8bf7ca4869851db5f24ff6e8fe08dc
|
| 3 |
+
size 4990095416
|
model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7811b66d29f1713a08a2c6f7b799109bb71f8a8eb960751c05fb9f717a87d9b7
|
| 3 |
+
size 4944309624
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:122c095ab16b76ac3c26ec172d81d80a54d7522ac35de09a5e8a1f7f2c3c0f65
|
| 3 |
+
size 4996759392
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0210b6073eeabe32ac32d50b19b4a99acc82b35dea9b27996d07365cb8bf9a16
|
| 3 |
+
size 1192264692
|
model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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"metadata": {
|
| 3 |
+
"total_parameters": 4030845194,
|
| 4 |
+
"total_size": 16123380788
|
| 5 |
+
},
|
| 6 |
+
"weight_map": {
|
| 7 |
+
"gnn.convs.0.eps": "model-00004-of-00004.safetensors",
|
| 8 |
+
"gnn.convs.0.nn.bias": "model-00004-of-00004.safetensors",
|
| 9 |
+
"gnn.convs.0.nn.weight": "model-00004-of-00004.safetensors",
|
| 10 |
+
"gnn.convs.1.eps": "model-00004-of-00004.safetensors",
|
| 11 |
+
"gnn.convs.1.nn.bias": "model-00004-of-00004.safetensors",
|
| 12 |
+
"gnn.convs.1.nn.weight": "model-00004-of-00004.safetensors",
|
| 13 |
+
"gnn.convs.2.eps": "model-00004-of-00004.safetensors",
|
| 14 |
+
"gnn.convs.2.nn.bias": "model-00004-of-00004.safetensors",
|
| 15 |
+
"gnn.convs.2.nn.weight": "model-00004-of-00004.safetensors",
|
| 16 |
+
"gnn.pos_emb.weight": "model-00004-of-00004.safetensors",
|
| 17 |
+
"llm.model.embed_tokens.weight": "model-00001-of-00004.safetensors",
|
| 18 |
+
"llm.model.layers.0.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 19 |
+
"llm.model.layers.0.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 20 |
+
"llm.model.layers.0.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 21 |
+
"llm.model.layers.0.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 22 |
+
"llm.model.layers.0.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 23 |
+
"llm.model.layers.0.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 24 |
+
"llm.model.layers.0.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 25 |
+
"llm.model.layers.0.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 26 |
+
"llm.model.layers.0.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 27 |
+
"llm.model.layers.0.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 28 |
+
"llm.model.layers.0.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 29 |
+
"llm.model.layers.1.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 30 |
+
"llm.model.layers.1.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 31 |
+
"llm.model.layers.1.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 32 |
+
"llm.model.layers.1.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 33 |
+
"llm.model.layers.1.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 34 |
+
"llm.model.layers.1.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 35 |
+
"llm.model.layers.1.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 36 |
+
"llm.model.layers.1.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 37 |
+
"llm.model.layers.1.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 38 |
+
"llm.model.layers.1.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 39 |
+
"llm.model.layers.1.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 40 |
+
"llm.model.layers.10.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 41 |
+
"llm.model.layers.10.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 42 |
+
"llm.model.layers.10.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 43 |
+
"llm.model.layers.10.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 44 |
+
"llm.model.layers.10.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 45 |
+
"llm.model.layers.10.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 46 |
+
"llm.model.layers.10.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 47 |
+
"llm.model.layers.10.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 48 |
+
"llm.model.layers.10.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 49 |
+
"llm.model.layers.10.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 50 |
+
"llm.model.layers.10.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 51 |
+
"llm.model.layers.11.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 52 |
+
"llm.model.layers.11.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 53 |
+
"llm.model.layers.11.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 54 |
+
"llm.model.layers.11.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 55 |
+
"llm.model.layers.11.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 56 |
+
"llm.model.layers.11.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 57 |
+
"llm.model.layers.11.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 58 |
+
"llm.model.layers.11.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 59 |
+
"llm.model.layers.11.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 60 |
+
"llm.model.layers.11.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 61 |
+
"llm.model.layers.11.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 62 |
+
"llm.model.layers.12.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 63 |
+
"llm.model.layers.12.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 64 |
+
"llm.model.layers.12.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 65 |
+
"llm.model.layers.12.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 66 |
+
"llm.model.layers.12.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 67 |
+
"llm.model.layers.12.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 68 |
+
"llm.model.layers.12.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 69 |
+
"llm.model.layers.12.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 70 |
+
"llm.model.layers.12.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 71 |
+
"llm.model.layers.12.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 72 |
+
"llm.model.layers.12.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 73 |
+
"llm.model.layers.13.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 74 |
+
"llm.model.layers.13.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 75 |
+
"llm.model.layers.13.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 76 |
+
"llm.model.layers.13.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 77 |
+
"llm.model.layers.13.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 78 |
+
"llm.model.layers.13.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 79 |
+
"llm.model.layers.13.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 80 |
+
"llm.model.layers.13.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 81 |
+
"llm.model.layers.13.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 82 |
+
"llm.model.layers.13.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 83 |
+
"llm.model.layers.13.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 84 |
+
"llm.model.layers.14.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 85 |
+
"llm.model.layers.14.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 86 |
+
"llm.model.layers.14.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 87 |
+
"llm.model.layers.14.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 88 |
+
"llm.model.layers.14.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 89 |
+
"llm.model.layers.14.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 90 |
+
"llm.model.layers.14.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 91 |
+
"llm.model.layers.14.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 92 |
+
"llm.model.layers.14.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 93 |
+
"llm.model.layers.14.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 94 |
+
"llm.model.layers.14.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 95 |
+
"llm.model.layers.15.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 96 |
+
"llm.model.layers.15.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 97 |
+
"llm.model.layers.15.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 98 |
+
"llm.model.layers.15.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 99 |
+
"llm.model.layers.15.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 100 |
+
"llm.model.layers.15.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 101 |
+
"llm.model.layers.15.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 102 |
+
"llm.model.layers.15.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 103 |
+
"llm.model.layers.15.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 104 |
+
"llm.model.layers.15.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 105 |
+
"llm.model.layers.15.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 106 |
+
"llm.model.layers.16.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 107 |
+
"llm.model.layers.16.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 108 |
+
"llm.model.layers.16.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 109 |
+
"llm.model.layers.16.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 110 |
+
"llm.model.layers.16.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 111 |
+
"llm.model.layers.16.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 112 |
+
"llm.model.layers.16.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 113 |
+
"llm.model.layers.16.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 114 |
+
"llm.model.layers.16.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 115 |
+
"llm.model.layers.16.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 116 |
+
"llm.model.layers.16.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 117 |
+
"llm.model.layers.17.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 118 |
+
"llm.model.layers.17.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 119 |
+
"llm.model.layers.17.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 120 |
+
"llm.model.layers.17.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 121 |
+
"llm.model.layers.17.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 122 |
+
"llm.model.layers.17.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 123 |
+
"llm.model.layers.17.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 124 |
+
"llm.model.layers.17.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 125 |
+
"llm.model.layers.17.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 126 |
+
"llm.model.layers.17.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 127 |
+
"llm.model.layers.17.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 128 |
+
"llm.model.layers.18.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 129 |
+
"llm.model.layers.18.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 130 |
+
"llm.model.layers.18.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 131 |
+
"llm.model.layers.18.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 132 |
+
"llm.model.layers.18.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 133 |
+
"llm.model.layers.18.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 134 |
+
"llm.model.layers.18.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 135 |
+
"llm.model.layers.18.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 136 |
+
"llm.model.layers.18.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 137 |
+
"llm.model.layers.18.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 138 |
+
"llm.model.layers.18.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 139 |
+
"llm.model.layers.19.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 140 |
+
"llm.model.layers.19.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 141 |
+
"llm.model.layers.19.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 142 |
+
"llm.model.layers.19.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 143 |
+
"llm.model.layers.19.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 144 |
+
"llm.model.layers.19.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 145 |
+
"llm.model.layers.19.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 146 |
+
"llm.model.layers.19.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 147 |
+
"llm.model.layers.19.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 148 |
+
"llm.model.layers.19.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 149 |
+
"llm.model.layers.19.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 150 |
+
"llm.model.layers.2.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 151 |
+
"llm.model.layers.2.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 152 |
+
"llm.model.layers.2.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 153 |
+
"llm.model.layers.2.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 154 |
+
"llm.model.layers.2.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 155 |
+
"llm.model.layers.2.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 156 |
+
"llm.model.layers.2.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 157 |
+
"llm.model.layers.2.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 158 |
+
"llm.model.layers.2.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 159 |
+
"llm.model.layers.2.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 160 |
+
"llm.model.layers.2.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 161 |
+
"llm.model.layers.20.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 162 |
+
"llm.model.layers.20.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 163 |
+
"llm.model.layers.20.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 164 |
+
"llm.model.layers.20.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 165 |
+
"llm.model.layers.20.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 166 |
+
"llm.model.layers.20.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 167 |
+
"llm.model.layers.20.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 168 |
+
"llm.model.layers.20.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 169 |
+
"llm.model.layers.20.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 170 |
+
"llm.model.layers.20.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 171 |
+
"llm.model.layers.20.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 172 |
+
"llm.model.layers.21.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 173 |
+
"llm.model.layers.21.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 174 |
+
"llm.model.layers.21.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 175 |
+
"llm.model.layers.21.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 176 |
+
"llm.model.layers.21.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 177 |
+
"llm.model.layers.21.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 178 |
+
"llm.model.layers.21.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 179 |
+
"llm.model.layers.21.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 180 |
+
"llm.model.layers.21.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 181 |
+
"llm.model.layers.21.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 182 |
+
"llm.model.layers.21.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 183 |
+
"llm.model.layers.22.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 184 |
+
"llm.model.layers.22.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 185 |
+
"llm.model.layers.22.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 186 |
+
"llm.model.layers.22.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 187 |
+
"llm.model.layers.22.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 188 |
+
"llm.model.layers.22.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 189 |
+
"llm.model.layers.22.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 190 |
+
"llm.model.layers.22.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 191 |
+
"llm.model.layers.22.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 192 |
+
"llm.model.layers.22.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 193 |
+
"llm.model.layers.22.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 194 |
+
"llm.model.layers.23.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 195 |
+
"llm.model.layers.23.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 196 |
+
"llm.model.layers.23.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 197 |
+
"llm.model.layers.23.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 198 |
+
"llm.model.layers.23.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 199 |
+
"llm.model.layers.23.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 200 |
+
"llm.model.layers.23.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 201 |
+
"llm.model.layers.23.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 202 |
+
"llm.model.layers.23.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 203 |
+
"llm.model.layers.23.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 204 |
+
"llm.model.layers.23.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 205 |
+
"llm.model.layers.24.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 206 |
+
"llm.model.layers.24.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 207 |
+
"llm.model.layers.24.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 208 |
+
"llm.model.layers.24.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 209 |
+
"llm.model.layers.24.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 210 |
+
"llm.model.layers.24.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 211 |
+
"llm.model.layers.24.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 212 |
+
"llm.model.layers.24.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 213 |
+
"llm.model.layers.24.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 214 |
+
"llm.model.layers.24.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 215 |
+
"llm.model.layers.24.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 216 |
+
"llm.model.layers.25.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 217 |
+
"llm.model.layers.25.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 218 |
+
"llm.model.layers.25.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 219 |
+
"llm.model.layers.25.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 220 |
+
"llm.model.layers.25.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 221 |
+
"llm.model.layers.25.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 222 |
+
"llm.model.layers.25.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 223 |
+
"llm.model.layers.25.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 224 |
+
"llm.model.layers.25.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 225 |
+
"llm.model.layers.25.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 226 |
+
"llm.model.layers.25.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 227 |
+
"llm.model.layers.26.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 228 |
+
"llm.model.layers.26.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 229 |
+
"llm.model.layers.26.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 230 |
+
"llm.model.layers.26.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 231 |
+
"llm.model.layers.26.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 232 |
+
"llm.model.layers.26.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 233 |
+
"llm.model.layers.26.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 234 |
+
"llm.model.layers.26.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 235 |
+
"llm.model.layers.26.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 236 |
+
"llm.model.layers.26.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 237 |
+
"llm.model.layers.26.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 238 |
+
"llm.model.layers.27.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 239 |
+
"llm.model.layers.27.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 240 |
+
"llm.model.layers.27.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 241 |
+
"llm.model.layers.27.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 242 |
+
"llm.model.layers.27.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 243 |
+
"llm.model.layers.27.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 244 |
+
"llm.model.layers.27.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 245 |
+
"llm.model.layers.27.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 246 |
+
"llm.model.layers.27.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 247 |
+
"llm.model.layers.27.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 248 |
+
"llm.model.layers.27.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 249 |
+
"llm.model.layers.28.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 250 |
+
"llm.model.layers.28.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 251 |
+
"llm.model.layers.28.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 252 |
+
"llm.model.layers.28.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 253 |
+
"llm.model.layers.28.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 254 |
+
"llm.model.layers.28.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 255 |
+
"llm.model.layers.28.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 256 |
+
"llm.model.layers.28.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 257 |
+
"llm.model.layers.28.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 258 |
+
"llm.model.layers.28.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 259 |
+
"llm.model.layers.28.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 260 |
+
"llm.model.layers.29.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 261 |
+
"llm.model.layers.29.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 262 |
+
"llm.model.layers.29.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 263 |
+
"llm.model.layers.29.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 264 |
+
"llm.model.layers.29.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 265 |
+
"llm.model.layers.29.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 266 |
+
"llm.model.layers.29.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 267 |
+
"llm.model.layers.29.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 268 |
+
"llm.model.layers.29.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 269 |
+
"llm.model.layers.29.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 270 |
+
"llm.model.layers.29.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 271 |
+
"llm.model.layers.3.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 272 |
+
"llm.model.layers.3.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 273 |
+
"llm.model.layers.3.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 274 |
+
"llm.model.layers.3.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 275 |
+
"llm.model.layers.3.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 276 |
+
"llm.model.layers.3.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 277 |
+
"llm.model.layers.3.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 278 |
+
"llm.model.layers.3.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 279 |
+
"llm.model.layers.3.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 280 |
+
"llm.model.layers.3.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 281 |
+
"llm.model.layers.3.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 282 |
+
"llm.model.layers.30.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 283 |
+
"llm.model.layers.30.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 284 |
+
"llm.model.layers.30.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 285 |
+
"llm.model.layers.30.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 286 |
+
"llm.model.layers.30.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 287 |
+
"llm.model.layers.30.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 288 |
+
"llm.model.layers.30.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 289 |
+
"llm.model.layers.30.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 290 |
+
"llm.model.layers.30.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 291 |
+
"llm.model.layers.30.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 292 |
+
"llm.model.layers.30.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 293 |
+
"llm.model.layers.31.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 294 |
+
"llm.model.layers.31.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 295 |
+
"llm.model.layers.31.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 296 |
+
"llm.model.layers.31.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 297 |
+
"llm.model.layers.31.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 298 |
+
"llm.model.layers.31.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 299 |
+
"llm.model.layers.31.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 300 |
+
"llm.model.layers.31.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 301 |
+
"llm.model.layers.31.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 302 |
+
"llm.model.layers.31.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 303 |
+
"llm.model.layers.31.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 304 |
+
"llm.model.layers.32.input_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 305 |
+
"llm.model.layers.32.mlp.down_proj.weight": "model-00003-of-00004.safetensors",
|
| 306 |
+
"llm.model.layers.32.mlp.gate_proj.weight": "model-00003-of-00004.safetensors",
|
| 307 |
+
"llm.model.layers.32.mlp.up_proj.weight": "model-00003-of-00004.safetensors",
|
| 308 |
+
"llm.model.layers.32.post_attention_layernorm.weight": "model-00003-of-00004.safetensors",
|
| 309 |
+
"llm.model.layers.32.self_attn.k_norm.weight": "model-00003-of-00004.safetensors",
|
| 310 |
+
"llm.model.layers.32.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 311 |
+
"llm.model.layers.32.self_attn.o_proj.weight": "model-00003-of-00004.safetensors",
|
| 312 |
+
"llm.model.layers.32.self_attn.q_norm.weight": "model-00003-of-00004.safetensors",
|
| 313 |
+
"llm.model.layers.32.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 314 |
+
"llm.model.layers.32.self_attn.v_proj.weight": "model-00003-of-00004.safetensors",
|
| 315 |
+
"llm.model.layers.33.input_layernorm.weight": "model-00004-of-00004.safetensors",
|
| 316 |
+
"llm.model.layers.33.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 317 |
+
"llm.model.layers.33.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
|
| 318 |
+
"llm.model.layers.33.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 319 |
+
"llm.model.layers.33.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
|
| 320 |
+
"llm.model.layers.33.self_attn.k_norm.weight": "model-00004-of-00004.safetensors",
|
| 321 |
+
"llm.model.layers.33.self_attn.k_proj.weight": "model-00003-of-00004.safetensors",
|
| 322 |
+
"llm.model.layers.33.self_attn.o_proj.weight": "model-00004-of-00004.safetensors",
|
| 323 |
+
"llm.model.layers.33.self_attn.q_norm.weight": "model-00004-of-00004.safetensors",
|
| 324 |
+
"llm.model.layers.33.self_attn.q_proj.weight": "model-00003-of-00004.safetensors",
|
| 325 |
+
"llm.model.layers.33.self_attn.v_proj.weight": "model-00004-of-00004.safetensors",
|
| 326 |
+
"llm.model.layers.34.input_layernorm.weight": "model-00004-of-00004.safetensors",
|
| 327 |
+
"llm.model.layers.34.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 328 |
+
"llm.model.layers.34.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
|
| 329 |
+
"llm.model.layers.34.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 330 |
+
"llm.model.layers.34.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
|
| 331 |
+
"llm.model.layers.34.self_attn.k_norm.weight": "model-00004-of-00004.safetensors",
|
| 332 |
+
"llm.model.layers.34.self_attn.k_proj.weight": "model-00004-of-00004.safetensors",
|
| 333 |
+
"llm.model.layers.34.self_attn.o_proj.weight": "model-00004-of-00004.safetensors",
|
| 334 |
+
"llm.model.layers.34.self_attn.q_norm.weight": "model-00004-of-00004.safetensors",
|
| 335 |
+
"llm.model.layers.34.self_attn.q_proj.weight": "model-00004-of-00004.safetensors",
|
| 336 |
+
"llm.model.layers.34.self_attn.v_proj.weight": "model-00004-of-00004.safetensors",
|
| 337 |
+
"llm.model.layers.35.input_layernorm.weight": "model-00004-of-00004.safetensors",
|
| 338 |
+
"llm.model.layers.35.mlp.down_proj.weight": "model-00004-of-00004.safetensors",
|
| 339 |
+
"llm.model.layers.35.mlp.gate_proj.weight": "model-00004-of-00004.safetensors",
|
| 340 |
+
"llm.model.layers.35.mlp.up_proj.weight": "model-00004-of-00004.safetensors",
|
| 341 |
+
"llm.model.layers.35.post_attention_layernorm.weight": "model-00004-of-00004.safetensors",
|
| 342 |
+
"llm.model.layers.35.self_attn.k_norm.weight": "model-00004-of-00004.safetensors",
|
| 343 |
+
"llm.model.layers.35.self_attn.k_proj.weight": "model-00004-of-00004.safetensors",
|
| 344 |
+
"llm.model.layers.35.self_attn.o_proj.weight": "model-00004-of-00004.safetensors",
|
| 345 |
+
"llm.model.layers.35.self_attn.q_norm.weight": "model-00004-of-00004.safetensors",
|
| 346 |
+
"llm.model.layers.35.self_attn.q_proj.weight": "model-00004-of-00004.safetensors",
|
| 347 |
+
"llm.model.layers.35.self_attn.v_proj.weight": "model-00004-of-00004.safetensors",
|
| 348 |
+
"llm.model.layers.4.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 349 |
+
"llm.model.layers.4.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 350 |
+
"llm.model.layers.4.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 351 |
+
"llm.model.layers.4.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 352 |
+
"llm.model.layers.4.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 353 |
+
"llm.model.layers.4.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 354 |
+
"llm.model.layers.4.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 355 |
+
"llm.model.layers.4.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 356 |
+
"llm.model.layers.4.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 357 |
+
"llm.model.layers.4.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 358 |
+
"llm.model.layers.4.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 359 |
+
"llm.model.layers.5.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 360 |
+
"llm.model.layers.5.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 361 |
+
"llm.model.layers.5.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 362 |
+
"llm.model.layers.5.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 363 |
+
"llm.model.layers.5.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 364 |
+
"llm.model.layers.5.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 365 |
+
"llm.model.layers.5.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 366 |
+
"llm.model.layers.5.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 367 |
+
"llm.model.layers.5.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 368 |
+
"llm.model.layers.5.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 369 |
+
"llm.model.layers.5.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 370 |
+
"llm.model.layers.6.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 371 |
+
"llm.model.layers.6.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 372 |
+
"llm.model.layers.6.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 373 |
+
"llm.model.layers.6.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 374 |
+
"llm.model.layers.6.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 375 |
+
"llm.model.layers.6.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 376 |
+
"llm.model.layers.6.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 377 |
+
"llm.model.layers.6.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 378 |
+
"llm.model.layers.6.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 379 |
+
"llm.model.layers.6.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 380 |
+
"llm.model.layers.6.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 381 |
+
"llm.model.layers.7.input_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 382 |
+
"llm.model.layers.7.mlp.down_proj.weight": "model-00001-of-00004.safetensors",
|
| 383 |
+
"llm.model.layers.7.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 384 |
+
"llm.model.layers.7.mlp.up_proj.weight": "model-00001-of-00004.safetensors",
|
| 385 |
+
"llm.model.layers.7.post_attention_layernorm.weight": "model-00001-of-00004.safetensors",
|
| 386 |
+
"llm.model.layers.7.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 387 |
+
"llm.model.layers.7.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 388 |
+
"llm.model.layers.7.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 389 |
+
"llm.model.layers.7.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 390 |
+
"llm.model.layers.7.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 391 |
+
"llm.model.layers.7.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 392 |
+
"llm.model.layers.8.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 393 |
+
"llm.model.layers.8.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 394 |
+
"llm.model.layers.8.mlp.gate_proj.weight": "model-00001-of-00004.safetensors",
|
| 395 |
+
"llm.model.layers.8.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 396 |
+
"llm.model.layers.8.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 397 |
+
"llm.model.layers.8.self_attn.k_norm.weight": "model-00001-of-00004.safetensors",
|
| 398 |
+
"llm.model.layers.8.self_attn.k_proj.weight": "model-00001-of-00004.safetensors",
|
| 399 |
+
"llm.model.layers.8.self_attn.o_proj.weight": "model-00001-of-00004.safetensors",
|
| 400 |
+
"llm.model.layers.8.self_attn.q_norm.weight": "model-00001-of-00004.safetensors",
|
| 401 |
+
"llm.model.layers.8.self_attn.q_proj.weight": "model-00001-of-00004.safetensors",
|
| 402 |
+
"llm.model.layers.8.self_attn.v_proj.weight": "model-00001-of-00004.safetensors",
|
| 403 |
+
"llm.model.layers.9.input_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 404 |
+
"llm.model.layers.9.mlp.down_proj.weight": "model-00002-of-00004.safetensors",
|
| 405 |
+
"llm.model.layers.9.mlp.gate_proj.weight": "model-00002-of-00004.safetensors",
|
| 406 |
+
"llm.model.layers.9.mlp.up_proj.weight": "model-00002-of-00004.safetensors",
|
| 407 |
+
"llm.model.layers.9.post_attention_layernorm.weight": "model-00002-of-00004.safetensors",
|
| 408 |
+
"llm.model.layers.9.self_attn.k_norm.weight": "model-00002-of-00004.safetensors",
|
| 409 |
+
"llm.model.layers.9.self_attn.k_proj.weight": "model-00002-of-00004.safetensors",
|
| 410 |
+
"llm.model.layers.9.self_attn.o_proj.weight": "model-00002-of-00004.safetensors",
|
| 411 |
+
"llm.model.layers.9.self_attn.q_norm.weight": "model-00002-of-00004.safetensors",
|
| 412 |
+
"llm.model.layers.9.self_attn.q_proj.weight": "model-00002-of-00004.safetensors",
|
| 413 |
+
"llm.model.layers.9.self_attn.v_proj.weight": "model-00002-of-00004.safetensors",
|
| 414 |
+
"llm.model.norm.weight": "model-00004-of-00004.safetensors",
|
| 415 |
+
"tokenizer_head.graph_pos.weight": "model-00004-of-00004.safetensors",
|
| 416 |
+
"tokenizer_head.project.0.bias": "model-00004-of-00004.safetensors",
|
| 417 |
+
"tokenizer_head.project.0.weight": "model-00004-of-00004.safetensors",
|
| 418 |
+
"tokenizer_head.project.2.bias": "model-00004-of-00004.safetensors",
|
| 419 |
+
"tokenizer_head.project.2.weight": "model-00004-of-00004.safetensors"
|
| 420 |
+
}
|
| 421 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
torch
|
| 2 |
+
transformers
|
| 3 |
+
huggingface_hub
|
| 4 |
+
safetensors
|
| 5 |
+
torch-geometric
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<|im_start|>",
|
| 4 |
+
"<|im_end|>",
|
| 5 |
+
"<|object_ref_start|>",
|
| 6 |
+
"<|object_ref_end|>",
|
| 7 |
+
"<|box_start|>",
|
| 8 |
+
"<|box_end|>",
|
| 9 |
+
"<|quad_start|>",
|
| 10 |
+
"<|quad_end|>",
|
| 11 |
+
"<|vision_start|>",
|
| 12 |
+
"<|vision_end|>",
|
| 13 |
+
"<|vision_pad|>",
|
| 14 |
+
"<|image_pad|>",
|
| 15 |
+
"<|video_pad|>"
|
| 16 |
+
],
|
| 17 |
+
"eos_token": {
|
| 18 |
+
"content": "<|endoftext|>",
|
| 19 |
+
"lstrip": false,
|
| 20 |
+
"normalized": false,
|
| 21 |
+
"rstrip": false,
|
| 22 |
+
"single_word": false
|
| 23 |
+
},
|
| 24 |
+
"pad_token": {
|
| 25 |
+
"content": "<|endoftext|>",
|
| 26 |
+
"lstrip": false,
|
| 27 |
+
"normalized": false,
|
| 28 |
+
"rstrip": false,
|
| 29 |
+
"single_word": false
|
| 30 |
+
}
|
| 31 |
+
}
|
tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aeb13307a71acd8fe81861d94ad54ab689df773318809eed3cbe794b4492dae4
|
| 3 |
+
size 11422654
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,239 @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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_bos_token": false,
|
| 3 |
+
"add_prefix_space": false,
|
| 4 |
+
"added_tokens_decoder": {
|
| 5 |
+
"151643": {
|
| 6 |
+
"content": "<|endoftext|>",
|
| 7 |
+
"lstrip": false,
|
| 8 |
+
"normalized": false,
|
| 9 |
+
"rstrip": false,
|
| 10 |
+
"single_word": false,
|
| 11 |
+
"special": true
|
| 12 |
+
},
|
| 13 |
+
"151644": {
|
| 14 |
+
"content": "<|im_start|>",
|
| 15 |
+
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false,
|
| 19 |
+
"special": true
|
| 20 |
+
},
|
| 21 |
+
"151645": {
|
| 22 |
+
"content": "<|im_end|>",
|
| 23 |
+
"lstrip": false,
|
| 24 |
+
"normalized": false,
|
| 25 |
+
"rstrip": false,
|
| 26 |
+
"single_word": false,
|
| 27 |
+
"special": true
|
| 28 |
+
},
|
| 29 |
+
"151646": {
|
| 30 |
+
"content": "<|object_ref_start|>",
|
| 31 |
+
"lstrip": false,
|
| 32 |
+
"normalized": false,
|
| 33 |
+
"rstrip": false,
|
| 34 |
+
"single_word": false,
|
| 35 |
+
"special": true
|
| 36 |
+
},
|
| 37 |
+
"151647": {
|
| 38 |
+
"content": "<|object_ref_end|>",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false,
|
| 43 |
+
"special": true
|
| 44 |
+
},
|
| 45 |
+
"151648": {
|
| 46 |
+
"content": "<|box_start|>",
|
| 47 |
+
"lstrip": false,
|
| 48 |
+
"normalized": false,
|
| 49 |
+
"rstrip": false,
|
| 50 |
+
"single_word": false,
|
| 51 |
+
"special": true
|
| 52 |
+
},
|
| 53 |
+
"151649": {
|
| 54 |
+
"content": "<|box_end|>",
|
| 55 |
+
"lstrip": false,
|
| 56 |
+
"normalized": false,
|
| 57 |
+
"rstrip": false,
|
| 58 |
+
"single_word": false,
|
| 59 |
+
"special": true
|
| 60 |
+
},
|
| 61 |
+
"151650": {
|
| 62 |
+
"content": "<|quad_start|>",
|
| 63 |
+
"lstrip": false,
|
| 64 |
+
"normalized": false,
|
| 65 |
+
"rstrip": false,
|
| 66 |
+
"single_word": false,
|
| 67 |
+
"special": true
|
| 68 |
+
},
|
| 69 |
+
"151651": {
|
| 70 |
+
"content": "<|quad_end|>",
|
| 71 |
+
"lstrip": false,
|
| 72 |
+
"normalized": false,
|
| 73 |
+
"rstrip": false,
|
| 74 |
+
"single_word": false,
|
| 75 |
+
"special": true
|
| 76 |
+
},
|
| 77 |
+
"151652": {
|
| 78 |
+
"content": "<|vision_start|>",
|
| 79 |
+
"lstrip": false,
|
| 80 |
+
"normalized": false,
|
| 81 |
+
"rstrip": false,
|
| 82 |
+
"single_word": false,
|
| 83 |
+
"special": true
|
| 84 |
+
},
|
| 85 |
+
"151653": {
|
| 86 |
+
"content": "<|vision_end|>",
|
| 87 |
+
"lstrip": false,
|
| 88 |
+
"normalized": false,
|
| 89 |
+
"rstrip": false,
|
| 90 |
+
"single_word": false,
|
| 91 |
+
"special": true
|
| 92 |
+
},
|
| 93 |
+
"151654": {
|
| 94 |
+
"content": "<|vision_pad|>",
|
| 95 |
+
"lstrip": false,
|
| 96 |
+
"normalized": false,
|
| 97 |
+
"rstrip": false,
|
| 98 |
+
"single_word": false,
|
| 99 |
+
"special": true
|
| 100 |
+
},
|
| 101 |
+
"151655": {
|
| 102 |
+
"content": "<|image_pad|>",
|
| 103 |
+
"lstrip": false,
|
| 104 |
+
"normalized": false,
|
| 105 |
+
"rstrip": false,
|
| 106 |
+
"single_word": false,
|
| 107 |
+
"special": true
|
| 108 |
+
},
|
| 109 |
+
"151656": {
|
| 110 |
+
"content": "<|video_pad|>",
|
| 111 |
+
"lstrip": false,
|
| 112 |
+
"normalized": false,
|
| 113 |
+
"rstrip": false,
|
| 114 |
+
"single_word": false,
|
| 115 |
+
"special": true
|
| 116 |
+
},
|
| 117 |
+
"151657": {
|
| 118 |
+
"content": "<tool_call>",
|
| 119 |
+
"lstrip": false,
|
| 120 |
+
"normalized": false,
|
| 121 |
+
"rstrip": false,
|
| 122 |
+
"single_word": false,
|
| 123 |
+
"special": false
|
| 124 |
+
},
|
| 125 |
+
"151658": {
|
| 126 |
+
"content": "</tool_call>",
|
| 127 |
+
"lstrip": false,
|
| 128 |
+
"normalized": false,
|
| 129 |
+
"rstrip": false,
|
| 130 |
+
"single_word": false,
|
| 131 |
+
"special": false
|
| 132 |
+
},
|
| 133 |
+
"151659": {
|
| 134 |
+
"content": "<|fim_prefix|>",
|
| 135 |
+
"lstrip": false,
|
| 136 |
+
"normalized": false,
|
| 137 |
+
"rstrip": false,
|
| 138 |
+
"single_word": false,
|
| 139 |
+
"special": false
|
| 140 |
+
},
|
| 141 |
+
"151660": {
|
| 142 |
+
"content": "<|fim_middle|>",
|
| 143 |
+
"lstrip": false,
|
| 144 |
+
"normalized": false,
|
| 145 |
+
"rstrip": false,
|
| 146 |
+
"single_word": false,
|
| 147 |
+
"special": false
|
| 148 |
+
},
|
| 149 |
+
"151661": {
|
| 150 |
+
"content": "<|fim_suffix|>",
|
| 151 |
+
"lstrip": false,
|
| 152 |
+
"normalized": false,
|
| 153 |
+
"rstrip": false,
|
| 154 |
+
"single_word": false,
|
| 155 |
+
"special": false
|
| 156 |
+
},
|
| 157 |
+
"151662": {
|
| 158 |
+
"content": "<|fim_pad|>",
|
| 159 |
+
"lstrip": false,
|
| 160 |
+
"normalized": false,
|
| 161 |
+
"rstrip": false,
|
| 162 |
+
"single_word": false,
|
| 163 |
+
"special": false
|
| 164 |
+
},
|
| 165 |
+
"151663": {
|
| 166 |
+
"content": "<|repo_name|>",
|
| 167 |
+
"lstrip": false,
|
| 168 |
+
"normalized": false,
|
| 169 |
+
"rstrip": false,
|
| 170 |
+
"single_word": false,
|
| 171 |
+
"special": false
|
| 172 |
+
},
|
| 173 |
+
"151664": {
|
| 174 |
+
"content": "<|file_sep|>",
|
| 175 |
+
"lstrip": false,
|
| 176 |
+
"normalized": false,
|
| 177 |
+
"rstrip": false,
|
| 178 |
+
"single_word": false,
|
| 179 |
+
"special": false
|
| 180 |
+
},
|
| 181 |
+
"151665": {
|
| 182 |
+
"content": "<tool_response>",
|
| 183 |
+
"lstrip": false,
|
| 184 |
+
"normalized": false,
|
| 185 |
+
"rstrip": false,
|
| 186 |
+
"single_word": false,
|
| 187 |
+
"special": false
|
| 188 |
+
},
|
| 189 |
+
"151666": {
|
| 190 |
+
"content": "</tool_response>",
|
| 191 |
+
"lstrip": false,
|
| 192 |
+
"normalized": false,
|
| 193 |
+
"rstrip": false,
|
| 194 |
+
"single_word": false,
|
| 195 |
+
"special": false
|
| 196 |
+
},
|
| 197 |
+
"151667": {
|
| 198 |
+
"content": "<think>",
|
| 199 |
+
"lstrip": false,
|
| 200 |
+
"normalized": false,
|
| 201 |
+
"rstrip": false,
|
| 202 |
+
"single_word": false,
|
| 203 |
+
"special": false
|
| 204 |
+
},
|
| 205 |
+
"151668": {
|
| 206 |
+
"content": "</think>",
|
| 207 |
+
"lstrip": false,
|
| 208 |
+
"normalized": false,
|
| 209 |
+
"rstrip": false,
|
| 210 |
+
"single_word": false,
|
| 211 |
+
"special": false
|
| 212 |
+
}
|
| 213 |
+
},
|
| 214 |
+
"additional_special_tokens": [
|
| 215 |
+
"<|im_start|>",
|
| 216 |
+
"<|im_end|>",
|
| 217 |
+
"<|object_ref_start|>",
|
| 218 |
+
"<|object_ref_end|>",
|
| 219 |
+
"<|box_start|>",
|
| 220 |
+
"<|box_end|>",
|
| 221 |
+
"<|quad_start|>",
|
| 222 |
+
"<|quad_end|>",
|
| 223 |
+
"<|vision_start|>",
|
| 224 |
+
"<|vision_end|>",
|
| 225 |
+
"<|vision_pad|>",
|
| 226 |
+
"<|image_pad|>",
|
| 227 |
+
"<|video_pad|>"
|
| 228 |
+
],
|
| 229 |
+
"bos_token": null,
|
| 230 |
+
"clean_up_tokenization_spaces": false,
|
| 231 |
+
"eos_token": "<|endoftext|>",
|
| 232 |
+
"errors": "replace",
|
| 233 |
+
"extra_special_tokens": {},
|
| 234 |
+
"model_max_length": 131072,
|
| 235 |
+
"pad_token": "<|endoftext|>",
|
| 236 |
+
"split_special_tokens": false,
|
| 237 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 238 |
+
"unk_token": null
|
| 239 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|