Instructions to use BAAI/Infinity-Instruct-7M-Gen-mistral-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/Infinity-Instruct-7M-Gen-mistral-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BAAI/Infinity-Instruct-7M-Gen-mistral-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-mistral-7B") model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-7M-Gen-mistral-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use BAAI/Infinity-Instruct-7M-Gen-mistral-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BAAI/Infinity-Instruct-7M-Gen-mistral-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BAAI/Infinity-Instruct-7M-Gen-mistral-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BAAI/Infinity-Instruct-7M-Gen-mistral-7B
- SGLang
How to use BAAI/Infinity-Instruct-7M-Gen-mistral-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "BAAI/Infinity-Instruct-7M-Gen-mistral-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BAAI/Infinity-Instruct-7M-Gen-mistral-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "BAAI/Infinity-Instruct-7M-Gen-mistral-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BAAI/Infinity-Instruct-7M-Gen-mistral-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BAAI/Infinity-Instruct-7M-Gen-mistral-7B with Docker Model Runner:
docker model run hf.co/BAAI/Infinity-Instruct-7M-Gen-mistral-7B
Add pipeline tag, library name, link to paper and Github repository
#2
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
datasets:
|
| 4 |
- BAAI/Infinity-Instruct
|
| 5 |
language:
|
| 6 |
- en
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
|
|
|
| 8 |
# Infinity Instruct
|
| 9 |
|
| 10 |
<p align="center">
|
|
@@ -12,7 +15,7 @@ language:
|
|
| 12 |
</p>
|
| 13 |
<p align="center">
|
| 14 |
<em>Beijing Academy of Artificial Intelligence (BAAI)</em><br/>
|
| 15 |
-
<em>[Paper][Code][
|
| 16 |
</p>
|
| 17 |
|
| 18 |
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.
|
|
@@ -74,7 +77,7 @@ Thanks to [FlagScale](https://github.com/FlagOpen/FlagScale), we could concatena
|
|
| 74 |
|
| 75 |
## **How to use**
|
| 76 |
|
| 77 |
-
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):
|
| 78 |
|
| 79 |
```bash
|
| 80 |
<|im_start|>system
|
|
@@ -144,13 +147,13 @@ The resources, including code, data, and model weights, associated with this pro
|
|
| 144 |
##
|
| 145 |
|
| 146 |
## **Citation**
|
| 147 |
-
Our paper, detailing the development and features of the **Infinity Instruct** dataset and finetuned models,
|
| 148 |
|
| 149 |
```
|
| 150 |
@article{InfinityInstruct2024,
|
| 151 |
-
title={Infinity Instruct},
|
| 152 |
author={Beijing Academy of Artificial Intelligence (BAAI)},
|
| 153 |
-
journal={arXiv preprint arXiv:
|
| 154 |
year={2024}
|
| 155 |
}
|
| 156 |
```
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
datasets:
|
| 3 |
- BAAI/Infinity-Instruct
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
library_name: transformers
|
| 9 |
---
|
| 10 |
+
|
| 11 |
# Infinity Instruct
|
| 12 |
|
| 13 |
<p align="center">
|
|
|
|
| 15 |
</p>
|
| 16 |
<p align="center">
|
| 17 |
<em>Beijing Academy of Artificial Intelligence (BAAI)</em><br/>
|
| 18 |
+
<em>[Paper](https://huggingface.co/papers/2506.11116)[Code](https://github.com/BAAI/Infinity-Instruct)[\ud83e\udd17] (would be released soon)</em>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
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.
|
|
|
|
| 77 |
|
| 78 |
## **How to use**
|
| 79 |
|
| 80 |
+
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):\
|
| 81 |
|
| 82 |
```bash
|
| 83 |
<|im_start|>system
|
|
|
|
| 147 |
##
|
| 148 |
|
| 149 |
## **Citation**
|
| 150 |
+
Our paper, detailing the development and features of the **Infinity Instruct** dataset and finetuned models, has been released on arXiv:
|
| 151 |
|
| 152 |
```
|
| 153 |
@article{InfinityInstruct2024,
|
| 154 |
+
title={Infinity Instruct: Scaling Instruction Selection and Synthesis to Enhance Language Models},
|
| 155 |
author={Beijing Academy of Artificial Intelligence (BAAI)},
|
| 156 |
+
journal={arXiv preprint arXiv:2506.11116},
|
| 157 |
year={2024}
|
| 158 |
}
|
| 159 |
```
|