Text Generation
Transformers
Safetensors
English
Chinese
megrez_moe
Mixture of Experts
conversational
custom_code
Instructions to use sii-research/InnoMegrez2-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sii-research/InnoMegrez2-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sii-research/InnoMegrez2-Preview", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("sii-research/InnoMegrez2-Preview", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sii-research/InnoMegrez2-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sii-research/InnoMegrez2-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sii-research/InnoMegrez2-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sii-research/InnoMegrez2-Preview
- SGLang
How to use sii-research/InnoMegrez2-Preview 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 "sii-research/InnoMegrez2-Preview" \ --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": "sii-research/InnoMegrez2-Preview", "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 "sii-research/InnoMegrez2-Preview" \ --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": "sii-research/InnoMegrez2-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sii-research/InnoMegrez2-Preview with Docker Model Runner:
docker model run hf.co/sii-research/InnoMegrez2-Preview
zyq commited on
Commit ·
af9d8af
1
Parent(s): 7522ec2
add readme
Browse files
README.md
CHANGED
|
@@ -13,9 +13,9 @@ library_name: transformers
|
|
| 13 |
<div align="center">
|
| 14 |
|
| 15 |
<br>
|
| 16 |
-
<h1> InnoMegrez2 </h1>
|
| 17 |
|
| 18 |
-
<a href="https://github.com/sii-research/InnoMegrez2">
|
| 19 |
<b>🔗 Github</b>
|
| 20 |
</a> |
|
| 21 |
<a href="https://github.com/sii-research/InnoMegrez2/blob/main/docs/tech_report.pdf">
|
|
@@ -33,7 +33,7 @@ library_name: transformers
|
|
| 33 |
|
| 34 |
## Introduction
|
| 35 |
|
| 36 |
-
InnoMegrez2 is a device native large language model. Megrez2 takes advantages of both the accuracy of Mixture-of-Experts (MoE) architecture and the compact size of Dense models. This preview model was trained on 5T Tokens of data. The official release, with larger training data and better reasoning and agent capabilities, will come later this year.
|
| 37 |
|
| 38 |
## Model Card
|
| 39 |
|
|
@@ -62,7 +62,7 @@ InnoMegrez2 is a device native large language model. Megrez2 takes advantages of
|
|
| 62 |
|
| 63 |
## Performance
|
| 64 |
|
| 65 |
-
We evaluated InnoMegrez2 using the open-source evaluation tool [OpenCompass](https://github.com/open-compass/opencompass) on several important benchmarks. Some of the evaluation results are shown in the table below.
|
| 66 |
|
| 67 |
<div align="center">
|
| 68 |
<table>
|
|
@@ -70,7 +70,7 @@ We evaluated InnoMegrez2 using the open-source evaluation tool [OpenCompass](htt
|
|
| 70 |
<tr>
|
| 71 |
<th align="center">Benchmark</th>
|
| 72 |
<th align="center">Metric</th>
|
| 73 |
-
<th align="center"><sup>InnoMegrez2</th>
|
| 74 |
<th align="center"><sup>Qwen2.5-3B</sup></th>
|
| 75 |
<th align="center"><sup>Qwen2.5-7B</sup></th>
|
| 76 |
<th align="center"><sup>Qwen3-4B</sup></th>
|
|
@@ -210,7 +210,7 @@ The following contains a code snippet illustrating how to use the model generate
|
|
| 210 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 211 |
import torch
|
| 212 |
|
| 213 |
-
path = "sii-research/InnoMegrez2"
|
| 214 |
device = "cuda"
|
| 215 |
|
| 216 |
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
|
|
@@ -240,7 +240,7 @@ print(responses)
|
|
| 240 |
|
| 241 |
## How to Deploy
|
| 242 |
|
| 243 |
-
InnoMegrez2 support using `vLLM` and `SGLang` as inference backends. For more information, please visit the [gitHub repository](https://github.com/sii-research/InnoMegrez2).
|
| 244 |
|
| 245 |
## Best Practice
|
| 246 |
|
|
|
|
| 13 |
<div align="center">
|
| 14 |
|
| 15 |
<br>
|
| 16 |
+
<h1> InnoMegrez2-Preview </h1>
|
| 17 |
|
| 18 |
+
<a href="https://github.com/sii-research/InnoMegrez2-Preview">
|
| 19 |
<b>🔗 Github</b>
|
| 20 |
</a> |
|
| 21 |
<a href="https://github.com/sii-research/InnoMegrez2/blob/main/docs/tech_report.pdf">
|
|
|
|
| 33 |
|
| 34 |
## Introduction
|
| 35 |
|
| 36 |
+
InnoMegrez2-Preview is a device native large language model. Megrez2 takes advantages of both the accuracy of Mixture-of-Experts (MoE) architecture and the compact size of Dense models. This preview model was trained on 5T Tokens of data. The official release, with larger training data and better reasoning and agent capabilities, will come later this year.
|
| 37 |
|
| 38 |
## Model Card
|
| 39 |
|
|
|
|
| 62 |
|
| 63 |
## Performance
|
| 64 |
|
| 65 |
+
We evaluated InnoMegrez2-Preview using the open-source evaluation tool [OpenCompass](https://github.com/open-compass/opencompass) on several important benchmarks. Some of the evaluation results are shown in the table below.
|
| 66 |
|
| 67 |
<div align="center">
|
| 68 |
<table>
|
|
|
|
| 70 |
<tr>
|
| 71 |
<th align="center">Benchmark</th>
|
| 72 |
<th align="center">Metric</th>
|
| 73 |
+
<th align="center"><sup>InnoMegrez2-Preview</th>
|
| 74 |
<th align="center"><sup>Qwen2.5-3B</sup></th>
|
| 75 |
<th align="center"><sup>Qwen2.5-7B</sup></th>
|
| 76 |
<th align="center"><sup>Qwen3-4B</sup></th>
|
|
|
|
| 210 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 211 |
import torch
|
| 212 |
|
| 213 |
+
path = "sii-research/InnoMegrez2-Preview"
|
| 214 |
device = "cuda"
|
| 215 |
|
| 216 |
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
|
|
|
|
| 240 |
|
| 241 |
## How to Deploy
|
| 242 |
|
| 243 |
+
InnoMegrez2-Preview support using `vLLM` and `SGLang` as inference backends. For more information, please visit the [gitHub repository](https://github.com/sii-research/InnoMegrez2).
|
| 244 |
|
| 245 |
## Best Practice
|
| 246 |
|