Instructions to use BAAI/Infinity-Instruct-3M-0625-Mistral-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BAAI/Infinity-Instruct-3M-0625-Mistral-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BAAI/Infinity-Instruct-3M-0625-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-3M-0625-Mistral-7B") model = AutoModelForCausalLM.from_pretrained("BAAI/Infinity-Instruct-3M-0625-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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use BAAI/Infinity-Instruct-3M-0625-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-3M-0625-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-3M-0625-Mistral-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BAAI/Infinity-Instruct-3M-0625-Mistral-7B
- SGLang
How to use BAAI/Infinity-Instruct-3M-0625-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-3M-0625-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-3M-0625-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-3M-0625-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-3M-0625-Mistral-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BAAI/Infinity-Instruct-3M-0625-Mistral-7B with Docker Model Runner:
docker model run hf.co/BAAI/Infinity-Instruct-3M-0625-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-3M-0625-Mistral-7B is an opensource supervised instruction tuning model without reinforcement learning from human feedback (RLHF). This model is just finetuned on [Infinity-Instruct-3M and Infinity-Instruct-0625](https://huggingface.co/datasets/BAAI/Infinity-Instruct) and showing favorable results on AlpacaEval 2.0 compared to Mixtral 8x7B v0.1, Gemini Pro, and GPT-3.5.
|
|
@@ -133,8 +136,6 @@ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
|
| 133 |
print(response)
|
| 134 |
```
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
## **Disclaimer**
|
| 139 |
|
| 140 |
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.
|
|
@@ -151,4 +152,4 @@ Our paper, detailing the development and features of the **Infinity Instruct** d
|
|
| 151 |
journal={arXiv preprint arXiv:2406.XXXX},
|
| 152 |
year={2024}
|
| 153 |
}
|
| 154 |
-
```
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
datasets:
|
| 3 |
- BAAI/Infinity-Instruct
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
library_name: transformers
|
| 8 |
+
pipeline_tag: text-generation
|
| 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/FlagOpen/FlagScale)[\ud83e\udd17] (would be released soon)</em>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
Infinity-Instruct-3M-0625-Mistral-7B is an opensource supervised instruction tuning model without reinforcement learning from human feedback (RLHF). This model is just finetuned on [Infinity-Instruct-3M and Infinity-Instruct-0625](https://huggingface.co/datasets/BAAI/Infinity-Instruct) and showing favorable results on AlpacaEval 2.0 compared to Mixtral 8x7B v0.1, Gemini Pro, and GPT-3.5.
|
|
|
|
| 136 |
print(response)
|
| 137 |
```
|
| 138 |
|
|
|
|
|
|
|
| 139 |
## **Disclaimer**
|
| 140 |
|
| 141 |
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.
|
|
|
|
| 152 |
journal={arXiv preprint arXiv:2406.XXXX},
|
| 153 |
year={2024}
|
| 154 |
}
|
| 155 |
+
```
|