Text Generation
Transformers
Safetensors
Chinese
English
lfm3
tool-calling
function-calling
agent
chinese
conversational
custom_code
Instructions to use whcl412/FinchAI-Rune2-Luna with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use whcl412/FinchAI-Rune2-Luna with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="whcl412/FinchAI-Rune2-Luna", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("whcl412/FinchAI-Rune2-Luna", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("whcl412/FinchAI-Rune2-Luna", trust_remote_code=True, device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use whcl412/FinchAI-Rune2-Luna with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "whcl412/FinchAI-Rune2-Luna" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "whcl412/FinchAI-Rune2-Luna", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/whcl412/FinchAI-Rune2-Luna
- SGLang
How to use whcl412/FinchAI-Rune2-Luna 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 "whcl412/FinchAI-Rune2-Luna" \ --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": "whcl412/FinchAI-Rune2-Luna", "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 "whcl412/FinchAI-Rune2-Luna" \ --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": "whcl412/FinchAI-Rune2-Luna", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use whcl412/FinchAI-Rune2-Luna with Docker Model Runner:
docker model run hf.co/whcl412/FinchAI-Rune2-Luna
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -16,33 +16,33 @@ tags:
|
|
| 16 |
- lfm3
|
| 17 |
---
|
| 18 |
|
| 19 |
-
#
|
| 20 |
|
| 21 |
-
>
|
| 22 |
> LoRA 微调,专注**工具调用判断力**与**多轮对话稳定性**。
|
| 23 |
>
|
| 24 |
> 相比 v2([`whcl412/FinchAI-Rune2-f16`](https://huggingface.co/whcl412/FinchAI-Rune2-f16)):
|
| 25 |
> 补了 139 条多轮样本,**多轮复读从 1 次降到 0 次**,其余能力全部保持。
|
| 26 |
|
| 27 |
-
![
|
| 28 |
|
| 29 |
> 图中数据:Rune1 为 7 项探针 × 5 次抽样,Rune2 为 14 项探针 × 2 次抽样,
|
| 30 |
> 各维度取该维度下所有探针的平均通过率。**两代口径不完全一致,仅供参考趋势。**
|
| 31 |
|
| 32 |
| | |
|
| 33 |
|---|---|
|
| 34 |
-
| **本仓库** | `-
|
| 35 |
| **能力范围** | 纯文本(**不含视觉**) |
|
| 36 |
| **上下文窗口** | 262144(256K),与底座一致;**但只在 1024 token 内训练过** |
|
| 37 |
| **加载方式** | `AutoModelForCausalLM` + `trust_remote_code=True` |
|
| 38 |
| **许可** | 继承底座 **LFM Open License v1.0**(不是 Apache 2.0) |
|
| 39 |
|
| 40 |
-
## 一、
|
| 41 |
|
| 42 |
v2 实测到一个严重问题:**连续聊到第 3~4 轮开始复读**——上下文里重复的模式会自我强化,
|
| 43 |
问什么都回同一句(实测「😊 笑脸。」连了四轮)。
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
| 数据类型 | 条数 | 教什么 |
|
| 48 |
|---|---|---|
|
|
@@ -57,7 +57,7 @@ v3 补了专门数据来治它:
|
|
| 57 |
|
| 58 |
按 5 个能力维度归并(每个维度取该维度下所有探针的平均通过率):
|
| 59 |
|
| 60 |
-
| 能力维度 | Rune1 v2 | Rune2 v2 | Rune2
|
| 61 |
|---|---|---|---|
|
| 62 |
| 身份自述 | 60% | 100% | **100%** |
|
| 63 |
| 工具调用 | 67% | 100% | **100%** |
|
|
@@ -69,7 +69,7 @@ v3 补了专门数据来治它:
|
|
| 69 |
⚠️ **口径说明**:Rune1 是 7 项探针 × 5 次抽样,Rune2 是 14 项探针 × 2 次抽样。
|
| 70 |
两代测试集不完全相同,上表是按维度归并后的近似对比,**看趋势而不是看小数点**。
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
```
|
| 75 |
说几个emoji → 😊🥳🎉👍👎📦📄📝🖋️💡🐛💻🚀🏠🌙 需要更多或者按主题分组?
|
|
@@ -94,7 +94,7 @@ pip install "transformers>=5.18.0" torch accelerate
|
|
| 94 |
```python
|
| 95 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 96 |
|
| 97 |
-
model_id = "whcl412/
|
| 98 |
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 99 |
model = AutoModelForCausalLM.from_pretrained(
|
| 100 |
model_id, dtype="bfloat16", device_map="auto", trust_remote_code=True)
|
|
@@ -131,7 +131,7 @@ print(tok.decode(out[0], skip_special_tokens=True))
|
|
| 131 |
|
| 132 |
### 1. 多轮仍建议做防护(虽然已经好很多)
|
| 133 |
|
| 134 |
-
|
| 135 |
|
| 136 |
```python
|
| 137 |
if len(msgs) > 9: # 只留最近 4 轮
|
|
@@ -177,7 +177,7 @@ if ans and last_ans and ans.strip() == last_ans:
|
|
| 177 |
|
| 178 |
- 底座:LFM3-1.7B(1.73B,三混合架构)
|
| 179 |
- 方法:LoRA r=8 / alpha=16,target 为 `q/k/v/o_proj` + `in_proj` + `out_proj` + `gate_proj`
|
| 180 |
-
- **
|
| 181 |
- 数据总量 1339 条,六类:agent 28.5% / 多轮 21.7% / refuse 17.0% /
|
| 182 |
code 14.9% / 闲聊 9.6% / 身份 8.4%
|
| 183 |
- 数据来源:DeepSeek V4.1-Flash 蒸馏(关键能力)+ 手写补充
|
|
@@ -197,7 +197,7 @@ if ans and last_ans and ans.strip() == last_ans:
|
|
| 197 |
|
| 198 |
## 七、项目信息
|
| 199 |
|
| 200 |
-
- 训练脚本与数据:[GitHub · hwc-cell/
|
| 201 |
- 上一版:[whcl412/FinchAI-Rune2-f16](https://huggingface.co/whcl412/FinchAI-Rune2-f16)(v2,1200 条)
|
| 202 |
- 第一代:[whcl412/FinchAI-Rune1-Preview-v2-f16](https://huggingface.co/whcl412/FinchAI-Rune1-Preview-v2-f16)
|
| 203 |
- 底座:[LiquidAI/LFM3-1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B)
|
|
|
|
| 16 |
- lfm3
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# RinchAI-Rune2-Luna
|
| 20 |
|
| 21 |
+
> RinchAI 系列第 2 代 · **Luna**。底座 [LFM3-1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B),
|
| 22 |
> LoRA 微调,专注**工具调用判断力**与**多轮对话稳定性**。
|
| 23 |
>
|
| 24 |
> 相比 v2([`whcl412/FinchAI-Rune2-f16`](https://huggingface.co/whcl412/FinchAI-Rune2-f16)):
|
| 25 |
> 补了 139 条多轮样本,**多轮复读从 1 次降到 0 次**,其余能力全部保持。
|
| 26 |
|
| 27 |
+

|
| 28 |
|
| 29 |
> 图中数据:Rune1 为 7 项探针 × 5 次抽样,Rune2 为 14 项探针 × 2 次抽样,
|
| 30 |
> 各维度取该维度下所有探针的平均通过率。**两代口径不完全一致,仅供参考趋势。**
|
| 31 |
|
| 32 |
| | |
|
| 33 |
|---|---|
|
| 34 |
+
| **本仓库** | `RinchAI-Rune2-Luna`(bfloat16 完整权重,3.24 GiB) |
|
| 35 |
| **能力范围** | 纯文本(**不含视觉**) |
|
| 36 |
| **上下文窗口** | 262144(256K),与底座一致;**但只在 1024 token 内训练过** |
|
| 37 |
| **加载方式** | `AutoModelForCausalLM` + `trust_remote_code=True` |
|
| 38 |
| **许可** | 继承底座 **LFM Open License v1.0**(不是 Apache 2.0) |
|
| 39 |
|
| 40 |
+
## 一、Luna 改了什么
|
| 41 |
|
| 42 |
v2 实测到一个严重问题:**连续聊到第 3~4 轮开始复读**——上下文里重复的模式会自我强化,
|
| 43 |
问什么都回同一句(实测「😊 笑脸。」连了四轮)。
|
| 44 |
|
| 45 |
+
Luna 补了专门数据来治它:
|
| 46 |
|
| 47 |
| 数据类型 | 条数 | 教什么 |
|
| 48 |
|---|---|---|
|
|
|
|
| 57 |
|
| 58 |
按 5 个能力维度归并(每个维度取该维度下所有探针的平均通过率):
|
| 59 |
|
| 60 |
+
| 能力维度 | Rune1 v2 | Rune2 v2 | Rune2 Luna |
|
| 61 |
|---|---|---|---|
|
| 62 |
| 身份自述 | 60% | 100% | **100%** |
|
| 63 |
| 工具调用 | 67% | 100% | **100%** |
|
|
|
|
| 69 |
⚠️ **口径说明**:Rune1 是 7 项探针 × 5 次抽样,Rune2 是 14 项探针 × 2 次抽样。
|
| 70 |
两代测试集不完全相同,上表是按维度归并后的近似对比,**看趋势而不是看小数点**。
|
| 71 |
|
| 72 |
+
Luna 的实际多轮表现:
|
| 73 |
|
| 74 |
```
|
| 75 |
说几个emoji → 😊🥳🎉👍👎📦📄📝🖋️💡🐛💻🚀🏠🌙 需要更多或者按主题分组?
|
|
|
|
| 94 |
```python
|
| 95 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 96 |
|
| 97 |
+
model_id = "whcl412/RinchAI-Rune2-Luna"
|
| 98 |
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 99 |
model = AutoModelForCausalLM.from_pretrained(
|
| 100 |
model_id, dtype="bfloat16", device_map="auto", trust_remote_code=True)
|
|
|
|
| 131 |
|
| 132 |
### 1. 多轮仍建议做防护(虽然已经好很多)
|
| 133 |
|
| 134 |
+
Luna 把复读治住了,但**上下文窗口建议仍然别开太长**:
|
| 135 |
|
| 136 |
```python
|
| 137 |
if len(msgs) > 9: # 只留最近 4 轮
|
|
|
|
| 177 |
|
| 178 |
- 底座:LFM3-1.7B(1.73B,三混合架构)
|
| 179 |
- 方法:LoRA r=8 / alpha=16,target 为 `q/k/v/o_proj` + `in_proj` + `out_proj` + `gate_proj`
|
| 180 |
+
- **Luna = 从 v2 的 adapter 续训**:+139 条多轮样本,83 步(0.5 epoch),lr 5e-5,15 分钟
|
| 181 |
- 数据总量 1339 条,六类:agent 28.5% / 多轮 21.7% / refuse 17.0% /
|
| 182 |
code 14.9% / 闲聊 9.6% / 身份 8.4%
|
| 183 |
- 数据来源:DeepSeek V4.1-Flash 蒸馏(关键能力)+ 手写补充
|
|
|
|
| 197 |
|
| 198 |
## 七、项目信息
|
| 199 |
|
| 200 |
+
- 训练脚本与数据:[GitHub · hwc-cell/RinchAI-Rune2-Luna](https://github.com/hwc-cell/RinchAI-Rune2-Luna)
|
| 201 |
- 上一版:[whcl412/FinchAI-Rune2-f16](https://huggingface.co/whcl412/FinchAI-Rune2-f16)(v2,1200 条)
|
| 202 |
- 第一代:[whcl412/FinchAI-Rune1-Preview-v2-f16](https://huggingface.co/whcl412/FinchAI-Rune1-Preview-v2-f16)
|
| 203 |
- 底座:[LiquidAI/LFM3-1.7B](https://huggingface.co/LiquidAI/LFM3-1.7B)
|