初始化项目,由ModelHub XC社区提供模型
Model: OuteAI/Lite-Mistral-150M-v2-Instruct Source: Original Platform
This commit is contained in:
36
.gitattributes
vendored
Normal file
36
.gitattributes
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
*.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
|
||||
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
||||
232
README.md
Normal file
232
README.md
Normal file
@@ -0,0 +1,232 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
---
|
||||
<style>
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
th, td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
.best {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div style="text-align: center; margin: 20px auto; padding: 20px; border: 3px solid #ddd; border-radius: 10px;">
|
||||
<h2 style="margin-bottom: 4px; margin-top: 0px;">OuteAI</h2>
|
||||
<a href="https://www.outeai.com/" target="_blank" style="margin-right: 10px;">🌎 OuteAI.com</a>
|
||||
<a href="https://discord.gg/vyBM87kAmf" target="_blank" style="margin-right: 10px;">🤝 Join our Discord</a>
|
||||
<a href="https://x.com/OuteAI" target="_blank">𝕏 @OuteAI</a>
|
||||
</div>
|
||||
|
||||
# Lite-Mistral-150M-v2-Instruct
|
||||
|
||||
This is a Lite series model based on the Mistral architecture, comprising approximately 157 million parameters. <br>
|
||||
The primary goal of this 150 million parameter model was to develop a compact and efficient model capable of operating on a wide range of devices, while maintaining a reasonable level of functionality and coherence for its small size. A smaller model scale may lead to challenges in preserving context over multi-turn conversations. Consequently, there is a risk of inconsistent or inaccurate responses. <br>
|
||||
|
||||
The model was trained on ~8 billion tokens.
|
||||
|
||||
<a href="https://huggingface.co/OuteAI/Lite-Mistral-150M-v2-Instruct">Lite-Mistral-150M-v2-Instruct</a> <br>
|
||||
<a href="https://huggingface.co/OuteAI/Lite-Mistral-150M-v2-Instruct-GGUF">Lite-Mistral-150M-v2-Instruct-GGUF</a> <br>
|
||||
|
||||
|
||||
## Improvements from v1:
|
||||
- Extended Training: Further refinement of the model, resulting in improved benchmark performance and overall text generation quality.
|
||||
- Tokenizer changes.
|
||||
|
||||
## Chat format
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This model is **sensitive** to the chat template used. Ensure you use the correct template:
|
||||
```
|
||||
<s>system
|
||||
[System message]</s>
|
||||
<s>user
|
||||
[Your question or message]</s>
|
||||
<s>assistant
|
||||
[The model's response]</s>
|
||||
```
|
||||
|
||||
## How coherent is the 150M model?
|
||||
Let's look at real-world examples:
|
||||
|
||||
<details open>
|
||||
<summary>Example 1</summary>
|
||||
|
||||
```
|
||||
<s>user
|
||||
What is the capital of France?</s>
|
||||
<s>assistant
|
||||
The capital of France is Paris.</s>
|
||||
<s>user
|
||||
What is the capital of Spain?</s>
|
||||
<s>assistant
|
||||
The capital of Spain is Madrid, which is known for its beautiful architecture and rich history.</s>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details open>
|
||||
<summary>Example 2</summary>
|
||||
|
||||
```
|
||||
<s>user
|
||||
Who wrote the play "Romeo and Juliet"?</s>
|
||||
<s>assistant
|
||||
The play "Romeo and Juliet" was written by William Shakespeare.</s>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Example 3</summary>
|
||||
|
||||
```
|
||||
<s>system
|
||||
You are a helpful assistant.</s>
|
||||
<s>user
|
||||
I'd like to learn about language models. Can you break down the concept for me?</s>
|
||||
<s>assistant
|
||||
Of course! Language models are computer programs designed to mimic human language, which is the way humans understand and interact with each other.
|
||||
They use algorithms to analyze data and generate responses that are similar to how humans do on their own.</s>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Example 4 (RP)</summary>
|
||||
|
||||
```
|
||||
[Input for the model]
|
||||
<s>user
|
||||
Let's roleplay. I'll be a customer at a restaurant, and you be the waiter. Ready?</s>
|
||||
<s>assistant
|
||||
Certainly! I'll play the role of a waiter. Please go ahead and start the roleplay when you're ready.</s>
|
||||
<s>user
|
||||
Hello, I'd like to see the menu please.</s>
|
||||
<s>assistant
|
||||
Good evening, sir! Welcome to our restaurant. Here's our menu for today. May I recommend our chef's special, the grilled salmon with lemon butter sauce? Let me know if you have any questions about our dishes.</s>
|
||||
<s>user
|
||||
I'll have the salmon. What wines do you recommend to go with it?</s>
|
||||
|
||||
[Model's response]
|
||||
<s> assistant
|
||||
To go with your salmon, we suggest a pair of red-tailed or white-tailed jackfights. The grilled salmon is creamy and has a nice acidity. The lemon butter sauce is a great addition to this dish.</s>
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
The model shows some promise in understanding context related to simple requests, but it's clear that it still struggles with more complex or nuanced situations.
|
||||
|
||||
## Benchmarks:
|
||||
|
||||
<table style="text-align: left;">
|
||||
<tr>
|
||||
<th>Benchmark</th>
|
||||
<th>5-shot (acc)</th>
|
||||
<th>5-shot (acc_norm)</th>
|
||||
<th>0-shot (acc)</th>
|
||||
<th>0-shot (acc_norm)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ARC Easy</td>
|
||||
<td>47.26</td>
|
||||
<td>46.30</td>
|
||||
<td>45.58</td>
|
||||
<td>39.52</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BoolQ</td>
|
||||
<td>43.33</td>
|
||||
<td>-</td>
|
||||
<td>44.16</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>HellaSWAG</td>
|
||||
<td>28.70</td>
|
||||
<td>30.73</td>
|
||||
<td>28.72</td>
|
||||
<td>31.01</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MMLU</td>
|
||||
<td>-</td>
|
||||
<td>-</td>
|
||||
<td>25.28</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>OpenBookQA</td>
|
||||
<td>16.00</td>
|
||||
<td>28.00</td>
|
||||
<td>18.20</td>
|
||||
<td>28.40</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PIQA</td>
|
||||
<td>62.79</td>
|
||||
<td>62.68</td>
|
||||
<td>62.02</td>
|
||||
<td>60.23</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Winogrande</td>
|
||||
<td>51.30</td>
|
||||
<td>-</td>
|
||||
<td>51.78</td>
|
||||
<td>-</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## Usage with HuggingFace transformers
|
||||
The model can be used with HuggingFace's `transformers` library:
|
||||
```python
|
||||
import torch
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("OuteAI/Lite-Mistral-150M-v2-Instruct").to(device)
|
||||
tokenizer = AutoTokenizer.from_pretrained("OuteAI/Lite-Mistral-150M-v2-Instruct")
|
||||
|
||||
def generate_response(message: str, temperature: float = 0.4, repetition_penalty: float = 1.1) -> str:
|
||||
# Apply the chat template and convert to PyTorch tensors
|
||||
messages = [
|
||||
{"role": "system", "content": "You are a helpful assistant."},
|
||||
{"role": "user", "content": message}
|
||||
]
|
||||
input_ids = tokenizer.apply_chat_template(
|
||||
messages, add_generation_prompt=True, return_tensors="pt"
|
||||
).to(device)
|
||||
|
||||
# Generate the response
|
||||
output = model.generate(
|
||||
input_ids,
|
||||
max_length=512,
|
||||
temperature=temperature,
|
||||
repetition_penalty=repetition_penalty,
|
||||
do_sample=True
|
||||
)
|
||||
|
||||
# Decode the generated output
|
||||
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
||||
return generated_text
|
||||
|
||||
message = "I'd like to learn about language models. Can you break down the concept for me?"
|
||||
response = generate_response(message)
|
||||
print(response)
|
||||
```
|
||||
|
||||
## Risk Disclaimer
|
||||
|
||||
By using this model, you acknowledge that you understand and assume the risks associated with its use.
|
||||
You are solely responsible for ensuring compliance with all applicable laws and regulations.
|
||||
We disclaim any liability for problems arising from the use of this open-source model, including but not limited to direct, indirect, incidental, consequential, or punitive damages.
|
||||
We make no warranties, express or implied, regarding the model's performance, accuracy, or fitness for a particular purpose. Your use of this model is at your own risk, and you agree to hold harmless and indemnify us, our affiliates, and our contributors from any claims, damages, or expenses arising from your use of the model.
|
||||
25
config.json
Normal file
25
config.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"architectures": [
|
||||
"MistralForCausalLM"
|
||||
],
|
||||
"attention_dropout": 0.0,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": 2,
|
||||
"hidden_act": "silu",
|
||||
"hidden_size": 768,
|
||||
"initializer_range": 0.02,
|
||||
"intermediate_size": 3072,
|
||||
"max_position_embeddings": 2048,
|
||||
"model_type": "mistral",
|
||||
"num_attention_heads": 16,
|
||||
"num_hidden_layers": 12,
|
||||
"num_key_value_heads": 8,
|
||||
"rms_norm_eps": 1e-06,
|
||||
"rope_theta": 10000.0,
|
||||
"sliding_window": 4096,
|
||||
"tie_word_embeddings": false,
|
||||
"torch_dtype": "float32",
|
||||
"transformers_version": "4.41.2",
|
||||
"use_cache": true,
|
||||
"vocab_size": 32768
|
||||
}
|
||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
||||
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||
6
generation_config.json
Normal file
6
generation_config.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"_from_model_config": true,
|
||||
"bos_token_id": 1,
|
||||
"eos_token_id": 2,
|
||||
"transformers_version": "4.41.2"
|
||||
}
|
||||
3
model.safetensors
Normal file
3
model.safetensors
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:60d47cd37ad9dc1900461c4effdd8762ae740c719f7dac33979dced68a3dfdfd
|
||||
size 626088992
|
||||
23
special_tokens_map.json
Normal file
23
special_tokens_map.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"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
|
||||
},
|
||||
"unk_token": {
|
||||
"content": "<unk>",
|
||||
"lstrip": false,
|
||||
"normalized": false,
|
||||
"rstrip": false,
|
||||
"single_word": false
|
||||
}
|
||||
}
|
||||
91123
tokenizer.json
Normal file
91123
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,
|
||||
"add_prefix_space": true,
|
||||
"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
|
||||
}
|
||||
},
|
||||
"bos_token": "<s>",
|
||||
"chat_template": "{% for message in messages %}{{bos_token + message['role'] + '\n' + message['content'] + eos_token + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ bos_token + 'assistant\n' }}{% endif %}",
|
||||
"clean_up_tokenization_spaces": false,
|
||||
"eos_token": "</s>",
|
||||
"legacy": true,
|
||||
"model_max_length": 1000000000000000019884624838656,
|
||||
"pad_token": null,
|
||||
"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