From ab418684db5b4eacfd8b2e9620119f59c3989fc5 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Sun, 28 Jun 2026 07:44:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: haykgrigorian/TimeCapsuleLLM-v2-llama-1.2B Source: Original Platform --- .gitattributes | 51 ++++++++++++++++++++++++++++ LICENSE | 22 ++++++++++++ README.md | 75 +++++++++++++++++++++++++++++++++++++++++ config.json | 30 +++++++++++++++++ configuration.json | 1 + generation_config.json | 8 +++++ model.safetensors | 3 ++ special_tokens_map.json | 6 ++++ tokenizer.json | 3 ++ tokenizer_config.json | 60 +++++++++++++++++++++++++++++++++ training_args.bin | 3 ++ 11 files changed, 262 insertions(+) create mode 100644 .gitattributes create mode 100644 LICENSE create mode 100644 README.md create mode 100644 config.json create mode 100644 configuration.json create mode 100644 generation_config.json create mode 100644 model.safetensors create mode 100644 special_tokens_map.json create mode 100644 tokenizer.json create mode 100644 tokenizer_config.json create mode 100644 training_args.bin diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4e2f299 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,51 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text + + +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zstandard filter=lfs diff=lfs merge=lfs -text +*.tfevents* filter=lfs diff=lfs merge=lfs -text +*.db* filter=lfs diff=lfs merge=lfs -text +*.ark* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text +**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text + +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.gguf* filter=lfs diff=lfs merge=lfs -text +*.ggml filter=lfs diff=lfs merge=lfs -text +*.llamafile* filter=lfs diff=lfs merge=lfs -text +*.pt2 filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text + +model.safetensors filter=lfs diff=lfs merge=lfs -text +training_args.bin filter=lfs diff=lfs merge=lfs -text +tokenizer.json filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fe02576 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ + + MIT License + +Copyright (c) 2025 Hayk Grigorian + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..d735eb7 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +--- +license: mit +language: +- en +pipeline_tag: text-generation +library_name: transformers +tags: +- llama +- historical +- causal-lm +datasets: +- postgrammar/london-llm-1800 +--- +# haykgrigorian/TimeCapsuleLLM-v2-London-1800-1875: Llama-Architecture 1.2B Model + +## Model Overview + +**v2** model, trained from scratch on 112GB of 1800-1875 london texts using a Llama-based Casual Language Model. + +| Detail | Value | +| :--- | :--- | +| **Model Architecture** | LlamaForCausalLM (Decoder-Only Transformer) | +| **Parameter Count** | **~1.22B** | +| **Training Type** | Trained **from Scratch** (Random Initialization) | +| **Tokenizer** | Custom BPE, Vocab Size 32,000 | +| **Sequence Length** | 2048 tokens | +| **Attention Type** | Grouped Query Attention (GQA) | + +## Configuration Details + +This model is a custom size and configuration based on Llama: + +| Parameter | Value | +| :--- | :--- | +| **Number of Layers** | 22 | +| **Hidden Size (d)** | 2048 | +| **Intermediate Size ($\text{d}_{\text{ff}}$)** | 5504 | +| **Attention Heads** | 16 (Query) / 8 (Key/Value) | +| **Activation Function** | SiLU (`silu`) | +| **Normalization** | RMS Norm (`rms_norm_eps`: 1e-06) | +| **Position Embeddings** | Rotary Positional Embeddings (RoPE) | + +## Training Info + +This model was trained for 182,000 steps, about 0.5 epochs. + +Training Metrics: + +Final Training Loss: 3.3951 + +Start Training Loss: 10.7932 + +Training Steps: 182,000 + +Epochs: 0.4997 + +Gradient Norm Stability: Consistently stable between 0.50 and 0.60 in later stages. + +Training time: 117 hours 51 minutes + +### Cost + +This model was trained on an H100 SXM from RunPod + +Total: $340.97 + +### How to Load and Run the Model + +Install all the files locally in a folder and run the test script. You will have to make some adjustments in the run script like updating the config/file path and test prompts + +### Test script + +A run file for testing and evaluating this model is available on the main project repository: + +* **Test Script Link:** [run_v2.py on GitHub](https://github.com/haykgrigo3/TimeCapsuleLLM/blob/main/london_1800_1875_v2/run_v2.py) \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..0e296aa --- /dev/null +++ b/config.json @@ -0,0 +1,30 @@ +{ + "architectures": [ + "LlamaForCausalLM" + ], + "attention_bias": false, + "attention_dropout": 0.0, + "bos_token_id": 0, + "dtype": "bfloat16", + "eos_token_id": 1, + "head_dim": 128, + "hidden_act": "silu", + "hidden_size": 2048, + "initializer_range": 0.02, + "intermediate_size": 5504, + "max_position_embeddings": 2048, + "mlp_bias": false, + "model_type": "llama", + "num_attention_heads": 16, + "num_hidden_layers": 22, + "num_key_value_heads": 8, + "pad_token_id": 3, + "pretraining_tp": 1, + "rms_norm_eps": 1e-06, + "rope_scaling": null, + "rope_theta": 10000.0, + "tie_word_embeddings": false, + "transformers_version": "4.57.3", + "use_cache": false, + "vocab_size": 32000 +} diff --git a/configuration.json b/configuration.json new file mode 100644 index 0000000..bbeeda1 --- /dev/null +++ b/configuration.json @@ -0,0 +1 @@ +{"framework": "pytorch", "task": "text-generation", "allow_remote": true} \ No newline at end of file diff --git a/generation_config.json b/generation_config.json new file mode 100644 index 0000000..13964a7 --- /dev/null +++ b/generation_config.json @@ -0,0 +1,8 @@ +{ + "_from_model_config": true, + "bos_token_id": 0, + "eos_token_id": 1, + "pad_token_id": 3, + "transformers_version": "4.57.3", + "use_cache": false +} diff --git a/model.safetensors b/model.safetensors new file mode 100644 index 0000000..71c1750 --- /dev/null +++ b/model.safetensors @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccf27f60f381de286250ebc4f67d258fbecda13371600d41ab16c9b9b4b1493a +size 2303928936 diff --git a/special_tokens_map.json b/special_tokens_map.json new file mode 100644 index 0000000..fdafe48 --- /dev/null +++ b/special_tokens_map.json @@ -0,0 +1,6 @@ +{ + "bos_token": "", + "eos_token": "", + "pad_token": "", + "unk_token": "" +} diff --git a/tokenizer.json b/tokenizer.json new file mode 100644 index 0000000..5f19e30 --- /dev/null +++ b/tokenizer.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b21a8bb830725dc9ca405a610c415add7c32131d38f71fa4104dcb6389c7a65f +size 2242737 diff --git a/tokenizer_config.json b/tokenizer_config.json new file mode 100644 index 0000000..165a802 --- /dev/null +++ b/tokenizer_config.json @@ -0,0 +1,60 @@ +{ + "added_tokens_decoder": { + "0": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "1": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "2": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "3": { + "content": "", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "4": { + "content": "<|year|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + }, + "5": { + "content": "<|title|>", + "lstrip": false, + "normalized": false, + "rstrip": false, + "single_word": false, + "special": true + } + }, + "bos_token": "", + "clean_up_tokenization_spaces": false, + "eos_token": "", + "extra_special_tokens": {}, + "model_max_length": 2048, + "pad_token": "", + "tokenizer_class": "PreTrainedTokenizerFast", + "unk_token": "" +} diff --git a/training_args.bin b/training_args.bin new file mode 100644 index 0000000..29150d6 --- /dev/null +++ b/training_args.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81bf17b9e97afdcdab50b41c451885d58db58b267bfd58d96b902c7fb76693db +size 5432