初始化项目,由ModelHub XC社区提供模型
Model: janhq/Mistral-7B-Instruct-v0.1-GGUF Source: Original Platform
This commit is contained in:
47
.gitattributes
vendored
Normal file
47
.gitattributes
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin.* 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
|
||||
*.safetensors 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
|
||||
87
README.md
Normal file
87
README.md
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
license: apache-2.0
|
||||
pipeline_tag: text-generation
|
||||
tags:
|
||||
- finetuned
|
||||
inference:
|
||||
parameters:
|
||||
temperature: 0.7
|
||||
---
|
||||
|
||||
# Model Card for Mistral-7B-Instruct-v0.1
|
||||
|
||||
The Mistral-7B-Instruct-v0.1 Large Language Model (LLM) is a instruct fine-tuned version of the [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) generative text model using a variety of publicly available conversation datasets.
|
||||
|
||||
For full details of this model please read our [paper](https://arxiv.org/abs/2310.06825) and [release blog post](https://mistral.ai/news/announcing-mistral-7b/).
|
||||
|
||||
## Instruction format
|
||||
|
||||
In order to leverage instruction fine-tuning, your prompt should be surrounded by `[INST]` and `[/INST]` tokens. The very first instruction should begin with a begin of sentence id. The next instructions should not. The assistant generation will be ended by the end-of-sentence token id.
|
||||
|
||||
E.g.
|
||||
```
|
||||
text = "<s>[INST] What is your favourite condiment? [/INST]"
|
||||
"Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
|
||||
"[INST] Do you have mayonnaise recipes? [/INST]"
|
||||
```
|
||||
|
||||
This format is available as a [chat template](https://huggingface.co/docs/transformers/main/chat_templating) via the `apply_chat_template()` method:
|
||||
|
||||
```python
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
device = "cuda" # the device to load the model onto
|
||||
|
||||
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
||||
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.1")
|
||||
|
||||
messages = [
|
||||
{"role": "user", "content": "What is your favourite condiment?"},
|
||||
{"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
|
||||
{"role": "user", "content": "Do you have mayonnaise recipes?"}
|
||||
]
|
||||
|
||||
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
||||
|
||||
model_inputs = encodeds.to(device)
|
||||
model.to(device)
|
||||
|
||||
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
|
||||
decoded = tokenizer.batch_decode(generated_ids)
|
||||
print(decoded[0])
|
||||
```
|
||||
|
||||
## Model Architecture
|
||||
This instruction model is based on Mistral-7B-v0.1, a transformer model with the following architecture choices:
|
||||
- Grouped-Query Attention
|
||||
- Sliding-Window Attention
|
||||
- Byte-fallback BPE tokenizer
|
||||
|
||||
## Troubleshooting
|
||||
- If you see the following error:
|
||||
```
|
||||
Traceback (most recent call last):
|
||||
File "", line 1, in
|
||||
File "/transformers/models/auto/auto_factory.py", line 482, in from_pretrained
|
||||
config, kwargs = AutoConfig.from_pretrained(
|
||||
File "/transformers/models/auto/configuration_auto.py", line 1022, in from_pretrained
|
||||
config_class = CONFIG_MAPPING[config_dict["model_type"]]
|
||||
File "/transformers/models/auto/configuration_auto.py", line 723, in getitem
|
||||
raise KeyError(key)
|
||||
KeyError: 'mistral'
|
||||
```
|
||||
|
||||
Installing transformers from source should solve the issue
|
||||
pip install git+https://github.com/huggingface/transformers
|
||||
|
||||
This should not be required after transformers-v4.33.4.
|
||||
|
||||
## Limitations
|
||||
|
||||
The Mistral 7B Instruct model is a quick demonstration that the base model can be easily fine-tuned to achieve compelling performance.
|
||||
It does not have any moderation mechanisms. We're looking forward to engaging with the community on ways to
|
||||
make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
|
||||
|
||||
## The Mistral AI Team
|
||||
|
||||
Albert Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lélio Renard Lavaud, Lucile Saulnier, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothée Lacroix, William El Sayed.
|
||||
1
configuration.json
Normal file
1
configuration.json
Normal file
@@ -0,0 +1 @@
|
||||
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}
|
||||
3
mistral-7b-instruct-v0.1.Q3_K_M.gguf
Normal file
3
mistral-7b-instruct-v0.1.Q3_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0d7474d4573970e318120033ea445e3bbb11434be956ba23c2ce263c3f3f7262
|
||||
size 3518986432
|
||||
3
mistral-7b-instruct-v0.1.Q4_K_M.gguf
Normal file
3
mistral-7b-instruct-v0.1.Q4_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6b923e4d4670a1e9e3ec7292a17df546d27904ac33acadc6c47ee195a1c60854
|
||||
size 4368439488
|
||||
3
mistral-7b-instruct-v0.1.Q5_K_M.gguf
Normal file
3
mistral-7b-instruct-v0.1.Q5_K_M.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a284555fb9d4f73275737392d65a784fdbf6bff0f19885e0e2a35e99df688e42
|
||||
size 5131409600
|
||||
3
mistral-7b-instruct-v0.1.Q8_0.gguf
Normal file
3
mistral-7b-instruct-v0.1.Q8_0.gguf
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ea5782333d6a9ab70a57b54157ac0828a121ecc15b05a46f0a720c905fb16f6e
|
||||
size 7695857856
|
||||
Reference in New Issue
Block a user