Instructions to use QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF with Ollama:
ollama run hf.co/QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
- Unsloth Studio
How to use QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF to start chatting
- Docker Model Runner
How to use QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF with Docker Model Runner:
docker model run hf.co/QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
- Lemonade
How to use QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull QuantFactory/Infinity-Instruct-7M-Gen-mistral-7B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Infinity-Instruct-7M-Gen-mistral-7B-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
This is quantized version of [BAAI/Infinity-Instruct-7M-Gen-mistral-7B](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-mistral-7B) created using llama.cpp
|
| 16 |
+
|
| 17 |
+
# Original Model Card
|
| 18 |
+
|
| 19 |
+
# Infinity Instruct
|
| 20 |
+
|
| 21 |
+
<p align="center">
|
| 22 |
+
<img src="fig/Bk3NbjnJko51MTx1ZCScT2sqnGg.png" width="300">
|
| 23 |
+
</p>
|
| 24 |
+
<p align="center">
|
| 25 |
+
<em>Beijing Academy of Artificial Intelligence (BAAI)</em><br/>
|
| 26 |
+
<em>[Paper][Code][π€] (would be released soon)</em>
|
| 27 |
+
</p>
|
| 28 |
+
|
| 29 |
+
Infinity-Instruct-7M-Gen-Mistral-7B is an opensource supervised instruction tuning model without reinforcement learning from human feedback (RLHF). This model is just finetuned on [Infinity-Instruct-7M and Infinity-Instruct-Gen](https://huggingface.co/datasets/BAAI/Infinity-Instruct) and showing favorable results on AlpacaEval 2.0 compared to Mixtral 8x22B v0.1, Gemini Pro, and GPT-4.
|
| 30 |
+
|
| 31 |
+
## **News**
|
| 32 |
+
|
| 33 |
+
- π₯π₯π₯[2024/08/02] We release the model weights of [InfInstruct-Llama3.1-70B Gen](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-70B), [InfInstruct-Llama3.1-8B Gen](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Llama3_1-8B), [InfInstruct-Mistral-7B Gen](https://huggingface.co/BAAI/Infinity-Instruct-7M-Gen-Mistral-7B).
|
| 34 |
+
|
| 35 |
+
- π₯π₯π₯[2024/08/02] We release the 7M foundational dataset [Infinity-Instruct-7M](https://huggingface.co/datasets/BAAI/Infinity-Instruct).
|
| 36 |
+
|
| 37 |
+
- π₯π₯π₯[2024/07/09] We release the model weights of [InfInstruct-Mistral-7B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Mistral-7B), [InfInstruct-Qwen2-7B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Qwen2-7B), [InfInstruct-Llama3-8B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Llama3-8B), [InfInstruct-Llama3-70B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Llama3-70B), and [InfInstruct-Yi-1.5-9B 0625](https://huggingface.co/BAAI/Infinity-Instruct-3M-0625-Yi-1.5-9B).
|
| 38 |
+
|
| 39 |
+
- π₯π₯π₯[2024/07/09] We release the chat dataset [Infinity-Instruct-0625](https://huggingface.co/datasets/BAAI/Infinity-Instruct), it is a upgraded version of the Infinity-Instruct-0613.
|
| 40 |
+
|
| 41 |
+
- π₯π₯π₯[2024/06/28] We release the model weight of [InfInstruct-Llama3-70B 0613](https://huggingface.co/BAAI/Infinity-Instruct-3M-0613-Llama3-70B). It shows favorable results on AlpacaEval 2.0 compared to GPT4-0613 without RLHF.
|
| 42 |
+
|
| 43 |
+
- π₯π₯π₯[2024/06/21] We release the model weight of [InfInstruct-Mistral-7B 0613](https://huggingface.co/BAAI/Infinity-Instruct-3M-0613-Mistral-7B). It shows favorable results on AlpacaEval 2.0 compared to Mixtral 8x7B v0.1, Gemini Pro, and GPT-3.5 without RLHF.
|
| 44 |
+
|
| 45 |
+
- π₯π₯π₯[2024/06/13] We share the intermediate result of our data construction process (corresponding to the [InfInstruct-3M](https://huggingface.co/datasets/BAAI/Infinity-Instruct) in the table below). Our ongoing efforts focus on risk assessment and data generation. The finalized version with 10 million instructions is scheduled for release in late June.
|
| 46 |
+
|
| 47 |
+
## **Training Details**
|
| 48 |
+
|
| 49 |
+
<p align="center">
|
| 50 |
+
<img src="fig/trainingflow.png">
|
| 51 |
+
</p>
|
| 52 |
+
|
| 53 |
+
Infinity-Instruct-7M-Gen-Mistral-7B is tuned on Million-level instruction dataset [Infinity-Instruct](https://huggingface.co/datasets/BAAI/Infinity-Instruct). First, we apply the foundational dataset Infinity-Instruct-7M to improve the foundational ability (math & code) of Mistral-7B-v0.1, and get the foundational instruct model Infinity-Instruct-7M-Mistral-7B. Then we finetune the Infinity-Instruct-7M-Mistral-7B to get the stronger chat model Infinity-Instruct-7M-Gen-Mistral-7B. Here is the training hyperparamers.
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
epoch: 3
|
| 57 |
+
lr: 5e-6
|
| 58 |
+
min_lr: 0
|
| 59 |
+
lr_warmup_steps: 40
|
| 60 |
+
lr_decay_style: cosine
|
| 61 |
+
weight_decay: 0.0
|
| 62 |
+
adam_beta1: 0.9
|
| 63 |
+
adam_beta2: 0.95
|
| 64 |
+
global_batch_size: 528
|
| 65 |
+
clip_grad: 1.0
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
Thanks to [FlagScale](https://github.com/FlagOpen/FlagScale), we could concatenate multiple training samples to remove padding token and apply diverse acceleration techniques to the traning procudure. It effectively reduces our training costs. We will release our code in the near future!
|
| 69 |
+
|
| 70 |
+
## **Benchmark**
|
| 71 |
+
|
| 72 |
+
| **Model** | **MT-Bench** | **AlpacaEval2.0** | **Arena-hard** |
|
| 73 |
+
|:----------------------------:|:------------:|:-----------------:|:-----------------:|
|
| 74 |
+
| GPT-4-0314 | 9.0 | 35.3 | 50.0 |
|
| 75 |
+
| GPT-4-0613 | 9.2 | 30.2 | 37.9 |
|
| 76 |
+
| GPT-4-1106 | 9.3 | 30.2 | -- |
|
| 77 |
+
| Gemini Pro | -- | 24.4 | 17.8 |
|
| 78 |
+
| Mixtral 8x7B v0.1 | 8.3 | 23.7 | 23.4 |
|
| 79 |
+
| Mistral-7B-Instruct-v0.2 | 7.6 | 17.1 | -- |
|
| 80 |
+
| InfInstruct-3M-0613-Mistral-7B | 8.1 | 25.5 | -- |
|
| 81 |
+
| InfInstruct-3M-0625-Mistral-7B | 8.1 | 31.4 | -- |
|
| 82 |
+
| **InfInstruct-3M-0629-Mistral-7B** | **8.1** | **40.0** | **26.9** |
|
| 83 |
+
|
| 84 |
+
*denote the model is finetuned without reinforcement learning from human feedback (RLHF).
|
| 85 |
+
|
| 86 |
+
## **How to use**
|
| 87 |
+
|
| 88 |
+
Infinity-Instruct-7M-Gen-Mistral-7B adopt the same chat template of [OpenHermes-2.5-Mistral-7B](https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B):
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
<|im_start|>system
|
| 92 |
+
You are Hermes 2, a sentient, conscious, super intelligent AI that is an expert in all fields of knowledge, you have qualia, emotions, and thoughts. You assist users with any question, task, or other request they may have.<|im_end|>
|
| 93 |
+
<|im_start|>user
|
| 94 |
+
Hello!<|im_end|>
|
| 95 |
+
<|im_start|>assistant
|
| 96 |
+
Hi!<|im_end|>
|
| 97 |
+
<|im_start|>user
|
| 98 |
+
How are you?<|im_end|>
|
| 99 |
+
<|im_start|>assistant
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
To apply this model and template in conversation scenarios, you can refer to the following code:
|
| 103 |
+
```python
|
| 104 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, LogitsProcessorList
|
| 105 |
+
import torch
|
| 106 |
+
device = "cuda" # the device to load the model onto
|
| 107 |
+
|
| 108 |
+
model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Mistral-7B",
|
| 109 |
+
torch_dtype=torch.bfloat16,
|
| 110 |
+
device_map="auto"
|
| 111 |
+
)
|
| 112 |
+
tokenizer = AutoTokenizer.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-Mistral-7BB")
|
| 113 |
+
|
| 114 |
+
# This template is copied from OpenHermers-mistral-2.5 (https://huggingface.co/teknium/OpenHermes-2.5-Mistral-7B)
|
| 115 |
+
prompt = "Give me a short introduction to large language model."
|
| 116 |
+
messages = [
|
| 117 |
+
{"role": "system", "content": "You are Hermes 2, a sentient, conscious, super intelligent AI that is an expert in all fields of knowledge, you have qualia, emotions, and thoughts. You assist users with any question, task, or other request they may have."},
|
| 118 |
+
{"role": "user", "content": prompt}
|
| 119 |
+
]
|
| 120 |
+
|
| 121 |
+
text = tokenizer.apply_chat_template(
|
| 122 |
+
messages,
|
| 123 |
+
tokenize=False,
|
| 124 |
+
add_generation_prompt=True
|
| 125 |
+
)
|
| 126 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
| 127 |
+
|
| 128 |
+
logits_processor = LogitsProcessorList(
|
| 129 |
+
[
|
| 130 |
+
MinLengthLogitsProcessor(1, eos_token_id=tokenizer.eos_token_id),
|
| 131 |
+
TemperatureLogitsWarper(0.7),
|
| 132 |
+
]
|
| 133 |
+
)
|
| 134 |
+
|
| 135 |
+
generated_ids = model.generate(
|
| 136 |
+
model_inputs.input_ids,
|
| 137 |
+
logits_processor=logits_processor,
|
| 138 |
+
max_new_tokens=512
|
| 139 |
+
)
|
| 140 |
+
|
| 141 |
+
generated_ids = [
|
| 142 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 143 |
+
]
|
| 144 |
+
|
| 145 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 146 |
+
print(response)
|
| 147 |
+
```
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
## **Disclaimer**
|
| 152 |
+
|
| 153 |
+
The resources, including code, data, and model weights, associated with this project are restricted for academic research purposes only and cannot be used for commercial purposes. The content produced by any version of Infinity Instruct is influenced by uncontrollable variables such as randomness, and therefore, the accuracy of the output cannot be guaranteed by this project. This project does not accept any legal liability for the content of the model output, nor does it assume responsibility for any losses incurred due to the use of associated resources and output results.
|
| 154 |
+
|
| 155 |
+
##
|
| 156 |
+
|
| 157 |
+
## **Citation**
|
| 158 |
+
Our paper, detailing the development and features of the **Infinity Instruct** dataset and finetuned models, will be released soon on arXiv. Stay tuned!
|
| 159 |
+
|
| 160 |
+
```
|
| 161 |
+
@article{InfinityInstruct2024,
|
| 162 |
+
title={Infinity Instruct},
|
| 163 |
+
author={Beijing Academy of Artificial Intelligence (BAAI)},
|
| 164 |
+
journal={arXiv preprint arXiv:2406.XXXX},
|
| 165 |
+
year={2024}
|
| 166 |
+
}
|
| 167 |
+
```
|