Text Generation
Transformers
Safetensors
English
qwen3
causal-lm
100m-parameters
single-gpu-training
flashattention2
gqa
Eval Results (legacy)
text-generation-inference
Instructions to use raincandy-u/Rain-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use raincandy-u/Rain-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="raincandy-u/Rain-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("raincandy-u/Rain-v2") model = AutoModelForCausalLM.from_pretrained("raincandy-u/Rain-v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use raincandy-u/Rain-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "raincandy-u/Rain-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/Rain-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/raincandy-u/Rain-v2
- SGLang
How to use raincandy-u/Rain-v2 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 "raincandy-u/Rain-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/Rain-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "raincandy-u/Rain-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "raincandy-u/Rain-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use raincandy-u/Rain-v2 with Docker Model Runner:
docker model run hf.co/raincandy-u/Rain-v2
Update README.md
Browse files
README.md
CHANGED
|
@@ -45,27 +45,24 @@ model-index:
|
|
| 45 |
|
| 46 |
# Rain-v2
|
| 47 |
|
| 48 |
-
Rain-v2 是一个约 1 亿参数的英文自回归语言模型,
|
| 49 |
|
| 50 |
## 模型与训练配置
|
| 51 |
|
| 52 |
- 参数规模:≈100M
|
| 53 |
- 架构:32 层解码器,隐藏维 512,8 头 GQA(4 个 KV 头),RoPE,RMSNorm,SwiGLU,输入/输出权重共享
|
| 54 |
-
- 词表:自训 BPE,16,384 词
|
| 55 |
- 上下文长度:1024
|
| 56 |
-
- 优化器:AdamW (β1=0.9, β2=0.999),梯度裁剪
|
| 57 |
-
- 精度:bfloat16
|
| 58 |
-
- Batch:65,536 tokens/step(单卡,无梯度累积)
|
| 59 |
- 学习率调度:1% warmup + cosine decay
|
| 60 |
- 训练总量:≈6.64×10^8 tokens,总用时 ~40 小时 @ RTX 4090
|
| 61 |
-
- 高效算子:FlashAttention 2
|
| 62 |
|
| 63 |
## 数据配比
|
| 64 |
|
| 65 |
- FineWeb-Edu(高质量英文教育语料)60%
|
| 66 |
- Stack-Edu(Python 教学代码/问答子集)30%
|
| 67 |
-
- FineMath-4+(高质量数学/逻辑)10%
|
| 68 |
-
|
|
|
|
| 69 |
|
| 70 |
## 评测摘要(5-shot)
|
| 71 |
|
|
@@ -76,7 +73,7 @@ Rain-v2 是一个约 1 亿参数的英文自回归语言模型,专为单张 RT
|
|
| 76 |
|
| 77 |
## 安全与限制
|
| 78 |
|
| 79 |
-
易输出错误事实或伪造信息。未经对齐,
|
| 80 |
|
| 81 |
## 使用示例
|
| 82 |
|
|
|
|
| 45 |
|
| 46 |
# Rain-v2
|
| 47 |
|
| 48 |
+
Rain-v2 是一个约 1 亿参数的英文自回归语言模型,在 RTX 4090 约两天内完成预训练,展示了在有限算力下从数据到模型的完整实践路径。
|
| 49 |
|
| 50 |
## 模型与训练配置
|
| 51 |
|
| 52 |
- 参数规模:≈100M
|
| 53 |
- 架构:32 层解码器,隐藏维 512,8 头 GQA(4 个 KV 头),RoPE,RMSNorm,SwiGLU,输入/输出权重共享
|
| 54 |
+
- 词表:自训 BPE,16,384 词,面向英文/代码/数学混合语料
|
| 55 |
- 上下文长度:1024
|
|
|
|
|
|
|
|
|
|
| 56 |
- 学习率调度:1% warmup + cosine decay
|
| 57 |
- 训练总量:≈6.64×10^8 tokens,总用时 ~40 小时 @ RTX 4090
|
|
|
|
| 58 |
|
| 59 |
## 数据配比
|
| 60 |
|
| 61 |
- FineWeb-Edu(高质量英文教育语料)60%
|
| 62 |
- Stack-Edu(Python 教学代码/问答子集)30%
|
| 63 |
+
- FineMath-4+(高质量数学/逻辑)10%
|
| 64 |
+
|
| 65 |
+
总量约 10 B。
|
| 66 |
|
| 67 |
## 评测摘要(5-shot)
|
| 68 |
|
|
|
|
| 73 |
|
| 74 |
## 安全与限制
|
| 75 |
|
| 76 |
+
易输出错误事实或伪造信息。未经对齐,会生成偏见/有害/违法内容;请勿直接面向终端用户。
|
| 77 |
|
| 78 |
## 使用示例
|
| 79 |
|