Skip to content

Commit 8c16f2d

Browse files
authored
fix: Restructure and rewite sampling logic to be compatible with split. (#587)
* Restructure and rewite sampling logic to be compatible with split. Signed-off-by: Dushyant Behl <[email protected]> * Restructure and rewite sampling logic to be compatible with split. Signed-off-by: Dushyant Behl <[email protected]> * Add a cached maykeye/tinyllama due to HF rate limiting crashing tests. Signed-off-by: Dushyant Behl <[email protected]> --------- Signed-off-by: Dushyant Behl <[email protected]>
1 parent 384c0ea commit 8c16f2d

19 files changed

+97435
-162
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright The FMS HF Tuning Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Helpful cached languaged models for unit tests.
16+
"""
17+
# Standard
18+
import os
19+
20+
### Constants used for model path
21+
PREDEFINED_MODEL_PATH = os.path.join(os.path.dirname(__file__))
22+
MAYKEYE_TINY_LLAMA_CACHED = os.path.join(PREDEFINED_MODEL_PATH, "maykeye-tinyllama-v0")
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"architectures": [
3+
"LlamaForCausalLM"
4+
],
5+
"bos_token_id": 1,
6+
"eos_token_id": 2,
7+
"hidden_act": "silu",
8+
"hidden_size": 64,
9+
"initializer_range": 0.02,
10+
"intermediate_size": 256,
11+
"max_position_embeddings": 2048,
12+
"model_type": "llama",
13+
"num_attention_heads": 16,
14+
"num_hidden_layers": 8,
15+
"pad_token_id": 0,
16+
"rms_norm_eps": 1e-06,
17+
"tie_word_embeddings": false,
18+
"torch_dtype": "bfloat16",
19+
"transformers_version": "4.30.2",
20+
"use_cache": true,
21+
"vocab_size": 32000
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"_from_model_config": true,
3+
"bos_token_id": 1,
4+
"eos_token_id": 2,
5+
"pad_token_id": 0,
6+
"transformers_version": "4.30.2"
7+
}
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"bos_token": {
3+
"content": "<s>",
4+
"lstrip": false,
5+
"normalized": true,
6+
"rstrip": false,
7+
"single_word": false
8+
},
9+
"eos_token": {
10+
"content": "</s>",
11+
"lstrip": false,
12+
"normalized": true,
13+
"rstrip": false,
14+
"single_word": false
15+
},
16+
"unk_token": {
17+
"content": "<unk>",
18+
"lstrip": false,
19+
"normalized": true,
20+
"rstrip": false,
21+
"single_word": false
22+
}
23+
}

0 commit comments

Comments
 (0)