初始化项目,由ModelHub XC社区提供模型
Model: Joseph717171/Tess-10.7B-v2.0 Source: Original Platform
This commit is contained in:
35
.gitattributes
vendored
Normal file
35
.gitattributes
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.ckpt 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
|
||||||
|
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.model filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npy filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.npz 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
|
||||||
|
*.pickle filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.pkl 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
|
||||||
|
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||||
|
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar.* 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
|
||||||
|
*.wasm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||||
167
README.md
Normal file
167
README.md
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
base_model: []
|
||||||
|
library_name: transformers
|
||||||
|
tags:
|
||||||
|
- mergekit
|
||||||
|
- merge
|
||||||
|
pipeline_tag: text-generation
|
||||||
|
---
|
||||||
|
# Credit for the model card's description goes to ddh0, mergekit, and, migtissera
|
||||||
|
# Inspired by ddh0/Starling-LM-10.7B-beta and ddh0/Mistral-10.7B-Instruct-v0.2
|
||||||
|
# Tess-10.7B-v0.2
|
||||||
|
|
||||||
|
# Deprecated
|
||||||
|
"This model is deprecated due to the use of wrong sliding window parameter while training. Will update with the new model link in a couple of days." - migtissera
|
||||||
|
|
||||||
|
This is Tess-10.7B-v0.2, a depth-upscaled version of [migtissera/Tess-7B-v2.0](https://huggingface.co/migtissera/Tess-7B-v2.0).
|
||||||
|
|
||||||
|
This model is intended to be used as a basis for further fine-tuning, or as a drop-in upgrade from the original 7 billion parameter model.
|
||||||
|
|
||||||
|
Paper detailing how Depth-Up Scaling works: [SOLAR 10.7B: Scaling Large Language Models with Simple yet Effective Depth Up-Scaling](https://arxiv.org/abs/2312.15166)
|
||||||
|
|
||||||
|
This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit).
|
||||||
|
|
||||||
|
|
||||||
|
# Prompt format same as [migtissera/Tess-7B-v2.0](https://huggingface.co/migtissera/Tess-7B-v2.0)
|
||||||
|
|
||||||
|
# Prompt Format:
|
||||||
|
|
||||||
|
```
|
||||||
|
SYSTEM: <ANY SYSTEM CONTEXT>
|
||||||
|
USER:
|
||||||
|
ASSISTANT:
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Merge Details
|
||||||
|
### Merge Method
|
||||||
|
|
||||||
|
This model was merged using the passthrough merge method.
|
||||||
|
|
||||||
|
### Models Merged
|
||||||
|
|
||||||
|
The following models were included in the merge:
|
||||||
|
* /Users/jsarnecki/opt/migtissera/Tess-7B-v2.0
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
The following YAML configuration was used to produce this model:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
dtype: bfloat16
|
||||||
|
merge_method: passthrough
|
||||||
|
slices:
|
||||||
|
- sources:
|
||||||
|
- layer_range: [0, 24]
|
||||||
|
model: /Users/jsarnecki/opt/migtissera/Tess-7B-v2.0
|
||||||
|
- sources:
|
||||||
|
- layer_range: [8, 32]
|
||||||
|
model: /Users/jsarnecki/opt/migtissera/Tess-7B-v2.0
|
||||||
|
|
||||||
|
```
|
||||||
|
# GGUFs (Thanks to [bartowski](https://huggingface.co/bartowski))
|
||||||
|
|
||||||
|
https://huggingface.co/bartowski/Tess-10.7B-v2.0-GGUF
|
||||||
|
|
||||||
|
# exl2s (Thanks to [bartowski](https://huggingface.co/bartowski))
|
||||||
|
|
||||||
|
https://huggingface.co/bartowski/Tess-10.7B-v2.0-exl2
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
---
|
||||||
|
license: apache-2.0
|
||||||
|
---
|
||||||
|
|
||||||
|
# Tess-7B-v2.0
|
||||||
|
Tess, short for Tesoro (Treasure in Italian), is a general purpose Large Language Model series. Tess-7B-v2.0 was trained on the Mistral-7B-v0.2 base.
|
||||||
|
|
||||||
|
# Prompt Format:
|
||||||
|
|
||||||
|
```
|
||||||
|
SYSTEM: <ANY SYSTEM CONTEXT>
|
||||||
|
USER:
|
||||||
|
ASSISTANT:
|
||||||
|
```
|
||||||
|
|
||||||
|
### Below shows a code example on how to use this model:
|
||||||
|
|
||||||
|
```python
|
||||||
|
import torch, json
|
||||||
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
|
|
||||||
|
model_path = "migtissera/Tess-7B-v2.0"
|
||||||
|
output_file_path = "./conversations.jsonl"
|
||||||
|
|
||||||
|
model = AutoModelForCausalLM.from_pretrained(
|
||||||
|
model_path,
|
||||||
|
torch_dtype=torch.float16,
|
||||||
|
device_map="auto",
|
||||||
|
load_in_8bit=False,
|
||||||
|
trust_remote_code=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
||||||
|
|
||||||
|
|
||||||
|
def generate_text(instruction):
|
||||||
|
tokens = tokenizer.encode(instruction)
|
||||||
|
tokens = torch.LongTensor(tokens).unsqueeze(0)
|
||||||
|
tokens = tokens.to("cuda")
|
||||||
|
|
||||||
|
instance = {
|
||||||
|
"input_ids": tokens,
|
||||||
|
"top_p": 1.0,
|
||||||
|
"temperature": 0.5,
|
||||||
|
"generate_len": 1024,
|
||||||
|
"top_k": 50,
|
||||||
|
}
|
||||||
|
|
||||||
|
length = len(tokens[0])
|
||||||
|
with torch.no_grad():
|
||||||
|
rest = model.generate(
|
||||||
|
input_ids=tokens,
|
||||||
|
max_length=length + instance["generate_len"],
|
||||||
|
use_cache=True,
|
||||||
|
do_sample=True,
|
||||||
|
top_p=instance["top_p"],
|
||||||
|
temperature=instance["temperature"],
|
||||||
|
top_k=instance["top_k"],
|
||||||
|
num_return_sequences=1,
|
||||||
|
)
|
||||||
|
output = rest[0][length:]
|
||||||
|
string = tokenizer.decode(output, skip_special_tokens=True)
|
||||||
|
answer = string.split("USER:")[0].strip()
|
||||||
|
return f"{answer}"
|
||||||
|
|
||||||
|
|
||||||
|
conversation = f"SYSTEM: Answer the question thoughtfully and intelligently. Always answer without hesitation."
|
||||||
|
|
||||||
|
|
||||||
|
while True:
|
||||||
|
user_input = input("You: ")
|
||||||
|
llm_prompt = f"{conversation} \nUSER: {user_input} \nASSISTANT: "
|
||||||
|
answer = generate_text(llm_prompt)
|
||||||
|
print(answer)
|
||||||
|
conversation = f"{llm_prompt}{answer}"
|
||||||
|
json_data = {"prompt": user_input, "answer": answer}
|
||||||
|
|
||||||
|
## Save your conversation
|
||||||
|
with open(output_file_path, "a") as output_file:
|
||||||
|
output_file.write(json.dumps(json_data) + "\n")
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
#### Limitations & Biases:
|
||||||
|
|
||||||
|
While this model aims for accuracy, it can occasionally produce inaccurate or misleading results.
|
||||||
|
|
||||||
|
Despite diligent efforts in refining the pretraining data, there remains a possibility for the generation of inappropriate, biased, or offensive content.
|
||||||
|
|
||||||
|
Exercise caution and cross-check information when necessary. This is an uncensored model.
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
26
config.json
Normal file
26
config.json
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"_name_or_path": "/Users/jsarnecki/opt/migtissera/Tess-7B-v2.0",
|
||||||
|
"architectures": [
|
||||||
|
"MistralForCausalLM"
|
||||||
|
],
|
||||||
|
"attention_dropout": 0.0,
|
||||||
|
"bos_token_id": 1,
|
||||||
|
"eos_token_id": 2,
|
||||||
|
"hidden_act": "silu",
|
||||||
|
"hidden_size": 4096,
|
||||||
|
"initializer_range": 0.02,
|
||||||
|
"intermediate_size": 14336,
|
||||||
|
"max_position_embeddings": 32768,
|
||||||
|
"model_type": "mistral",
|
||||||
|
"num_attention_heads": 32,
|
||||||
|
"num_hidden_layers": 48,
|
||||||
|
"num_key_value_heads": 8,
|
||||||
|
"rms_norm_eps": 1e-05,
|
||||||
|
"rope_theta": 1000000.0,
|
||||||
|
"sliding_window": 32768,
|
||||||
|
"tie_word_embeddings": false,
|
||||||
|
"torch_dtype": "bfloat16",
|
||||||
|
"transformers_version": "4.39.0.dev0",
|
||||||
|
"use_cache": false,
|
||||||
|
"vocab_size": 32000
|
||||||
|
}
|
||||||
9
mergekit_config.yml
Normal file
9
mergekit_config.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
dtype: bfloat16
|
||||||
|
merge_method: passthrough
|
||||||
|
slices:
|
||||||
|
- sources:
|
||||||
|
- layer_range: [0, 24]
|
||||||
|
model: /Users/jsarnecki/opt/migtissera/Tess-7B-v2.0
|
||||||
|
- sources:
|
||||||
|
- layer_range: [8, 32]
|
||||||
|
model: /Users/jsarnecki/opt/migtissera/Tess-7B-v2.0
|
||||||
3
model-00001-of-00006.safetensors
Normal file
3
model-00001-of-00006.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:edf02d539c508fd8e27ccbe990129ae80f55c698e1d906a497fa2e1dbd97ccac
|
||||||
|
size 3925992176
|
||||||
3
model-00002-of-00006.safetensors
Normal file
3
model-00002-of-00006.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:78686aed1c45ad8732df022517a0672768e57f96cfbe0d84a9192cb0cdec5b0d
|
||||||
|
size 3986826216
|
||||||
3
model-00003-of-00006.safetensors
Normal file
3
model-00003-of-00006.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:73f0e188e5641dc91560bdd7c36ceaf04849f7d5da9e7b418e14445ae8842d9d
|
||||||
|
size 3976357448
|
||||||
3
model-00004-of-00006.safetensors
Normal file
3
model-00004-of-00006.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:b9fb04c1a6e377365f1769cd2c5e467b245a5815486c7a8b7d7198802cb354cd
|
||||||
|
size 3976357464
|
||||||
3
model-00005-of-00006.safetensors
Normal file
3
model-00005-of-00006.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:8b87d342f12eb1623cf49c4274508b6d2d87123ac91ca651e5234422ac256b97
|
||||||
|
size 3986875576
|
||||||
3
model-00006-of-00006.safetensors
Normal file
3
model-00006-of-00006.safetensors
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:9db7f19aefcb1be1832d3f23233b19a0e85a1a1584161b6b68d13333a4c6f8e0
|
||||||
|
size 1610689944
|
||||||
1
model.safetensors.index.json
Normal file
1
model.safetensors.index.json
Normal file
File diff suppressed because one or more lines are too long
30
special_tokens_map.json
Normal file
30
special_tokens_map.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"bos_token": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"eos_token": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"pad_token": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
},
|
||||||
|
"unk_token": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false
|
||||||
|
}
|
||||||
|
}
|
||||||
91122
tokenizer.json
Normal file
91122
tokenizer.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
BIN
tokenizer.model
(Stored with Git LFS)
Normal file
Binary file not shown.
43
tokenizer_config.json
Normal file
43
tokenizer_config.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"add_bos_token": true,
|
||||||
|
"add_eos_token": false,
|
||||||
|
"added_tokens_decoder": {
|
||||||
|
"0": {
|
||||||
|
"content": "<unk>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"1": {
|
||||||
|
"content": "<s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
},
|
||||||
|
"2": {
|
||||||
|
"content": "</s>",
|
||||||
|
"lstrip": false,
|
||||||
|
"normalized": false,
|
||||||
|
"rstrip": false,
|
||||||
|
"single_word": false,
|
||||||
|
"special": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additional_special_tokens": [],
|
||||||
|
"bos_token": "<s>",
|
||||||
|
"chat_template": "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% if message['role'] == 'user' %}{{ '[INST] ' + message['content'] + ' [/INST]' }}{% elif message['role'] == 'assistant' %}{{ message['content'] + eos_token}}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}",
|
||||||
|
"clean_up_tokenization_spaces": false,
|
||||||
|
"eos_token": "</s>",
|
||||||
|
"legacy": true,
|
||||||
|
"model_max_length": 1000000000000000019884624838656,
|
||||||
|
"pad_token": "</s>",
|
||||||
|
"sp_model_kwargs": {},
|
||||||
|
"spaces_between_special_tokens": false,
|
||||||
|
"tokenizer_class": "LlamaTokenizer",
|
||||||
|
"unk_token": "<unk>",
|
||||||
|
"use_default_system_prompt": false
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user