Instructions to use inclusionAI/Ring-flash-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/Ring-flash-2.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="inclusionAI/Ring-flash-2.0", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("inclusionAI/Ring-flash-2.0", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use inclusionAI/Ring-flash-2.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "inclusionAI/Ring-flash-2.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "inclusionAI/Ring-flash-2.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/inclusionAI/Ring-flash-2.0
- SGLang
How to use inclusionAI/Ring-flash-2.0 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 "inclusionAI/Ring-flash-2.0" \ --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": "inclusionAI/Ring-flash-2.0", "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 "inclusionAI/Ring-flash-2.0" \ --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": "inclusionAI/Ring-flash-2.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use inclusionAI/Ring-flash-2.0 with Docker Model Runner:
docker model run hf.co/inclusionAI/Ring-flash-2.0
Update README.md (#3)
Browse files- Update README.md (9c6cd94fa26a8602a758cf40800cc9baf4bcfc62)
Co-authored-by: Ye Zhenjie <thinkthinking@users.noreply.huggingface.co>
README.md
CHANGED
|
@@ -9,7 +9,7 @@ library_name: transformers
|
|
| 9 |
<p align="center">
|
| 10 |
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*4QxcQrBlTiAAAAAAQXAAAAgAemJ7AQ/original" width="100"/>
|
| 11 |
<p>
|
| 12 |
-
<p align="center">🤗 <a href="https://huggingface.co/inclusionAI">Hugging Face</a>   |   🤖 <a href="https://modelscope.cn/organization/inclusionAI">ModelScope</a></p>
|
| 13 |
|
| 14 |
## Introduction
|
| 15 |
|
|
@@ -71,6 +71,40 @@ During RL training, we compared directly combining RLVR and RLHF into joint trai
|
|
| 71 |
|
| 72 |
## Quickstart
|
| 73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
### 🤗 Hugging Face Transformers
|
| 75 |
|
| 76 |
Here is a code snippet to show you how to use the chat model with `transformers`:
|
|
|
|
| 9 |
<p align="center">
|
| 10 |
<img src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*4QxcQrBlTiAAAAAAQXAAAAgAemJ7AQ/original" width="100"/>
|
| 11 |
<p>
|
| 12 |
+
<p align="center">🤗 <a href="https://huggingface.co/inclusionAI">Hugging Face</a>   |   🤖 <a href="https://modelscope.cn/organization/inclusionAI">ModelScope</a>   |   🚀 <a href="https://zenmux.ai/inclusionai/ring-flash-2.0?utm_source=hf_inclusionAI">Experience Now</a></p>
|
| 13 |
|
| 14 |
## Introduction
|
| 15 |
|
|
|
|
| 71 |
|
| 72 |
## Quickstart
|
| 73 |
|
| 74 |
+
### 🚀 Try Online
|
| 75 |
+
|
| 76 |
+
You can experience Ring-flash-2.0 online at: [ZenMux](https://zenmux.ai/inclusionai/ring-flash-2.0?utm_source=hf_inclusionAI)
|
| 77 |
+
|
| 78 |
+
### 🔌 API Usage
|
| 79 |
+
|
| 80 |
+
You can also use Ring-flash-2.0 through API calls:
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from openai import OpenAI
|
| 84 |
+
|
| 85 |
+
# 1. Initialize the OpenAI client
|
| 86 |
+
client = OpenAI(
|
| 87 |
+
# 2. Point the base URL to the ZenMux endpoint
|
| 88 |
+
base_url="https://zenmux.ai/api/v1",
|
| 89 |
+
# 3. Replace with the API Key from your ZenMux user console
|
| 90 |
+
api_key="<your ZENMUX_API_KEY>",
|
| 91 |
+
)
|
| 92 |
+
|
| 93 |
+
# 4. Make a request
|
| 94 |
+
completion = client.chat.completions.create(
|
| 95 |
+
# 5. Specify the model to use in the format "provider/model-name"
|
| 96 |
+
model="inclusionai/ring-flash-2.0",
|
| 97 |
+
messages=[
|
| 98 |
+
{
|
| 99 |
+
"role": "user",
|
| 100 |
+
"content": "What is the meaning of life?"
|
| 101 |
+
}
|
| 102 |
+
]
|
| 103 |
+
)
|
| 104 |
+
|
| 105 |
+
print(completion.choices[0].message.content)
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
### 🤗 Hugging Face Transformers
|
| 109 |
|
| 110 |
Here is a code snippet to show you how to use the chat model with `transformers`:
|