Instructions to use FFZwai/leyoai-flow-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use FFZwai/leyoai-flow-medium with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct") model = PeftModel.from_pretrained(base_model, "FFZwai/leyoai-flow-medium") - Transformers
How to use FFZwai/leyoai-flow-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FFZwai/leyoai-flow-medium") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FFZwai/leyoai-flow-medium", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use FFZwai/leyoai-flow-medium with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FFZwai/leyoai-flow-medium" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FFZwai/leyoai-flow-medium", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FFZwai/leyoai-flow-medium
- SGLang
How to use FFZwai/leyoai-flow-medium 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 "FFZwai/leyoai-flow-medium" \ --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": "FFZwai/leyoai-flow-medium", "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 "FFZwai/leyoai-flow-medium" \ --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": "FFZwai/leyoai-flow-medium", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FFZwai/leyoai-flow-medium with Docker Model Runner:
docker model run hf.co/FFZwai/leyoai-flow-medium
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,33 +1,109 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
-
#
|
| 12 |
|
| 13 |
-
|
| 14 |
-
Base: Qwen2.5-1.5B-Instruct + LoRA (LoRA r=16, ~3K samples)
|
| 15 |
|
| 16 |
-
##
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
- **Analytics Model**: Data Analytics Assistant
|
| 23 |
|
| 24 |
-
## Usage
|
|
|
|
|
|
|
|
|
|
| 25 |
|
|
|
|
| 26 |
```python
|
|
|
|
| 27 |
from peft import PeftModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
|
|
|
|
|
|
| 33 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- zh
|
| 6 |
tags:
|
| 7 |
+
- workflow-automation
|
| 8 |
+
- process-automation
|
| 9 |
+
- qwen2.5
|
| 10 |
+
- lora
|
| 11 |
+
- leyoai
|
| 12 |
+
base_model: Qwen/Qwen2.5-3B-Instruct
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# LeyoAI Flow Automation Assistant (Medium)
|
| 16 |
|
| 17 |
+
English | [中文](#中文)
|
|
|
|
| 18 |
|
| 19 |
+
## English
|
| 20 |
+
|
| 21 |
+
### Model Description
|
| 22 |
+
Enhanced workflow automation and classification assistant
|
| 23 |
|
| 24 |
+
### Installation
|
| 25 |
+
```bash
|
| 26 |
+
pip install transformers peft torch
|
| 27 |
+
```
|
|
|
|
| 28 |
|
| 29 |
+
### Usage Scenarios
|
| 30 |
+
- Workflow classification
|
| 31 |
+
- Process automation
|
| 32 |
+
- Task routing
|
| 33 |
|
| 34 |
+
### How to Use
|
| 35 |
```python
|
| 36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 37 |
from peft import PeftModel
|
| 38 |
+
|
| 39 |
+
# Load base model
|
| 40 |
+
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
|
| 41 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
|
| 42 |
+
|
| 43 |
+
# Load LoRA adapter
|
| 44 |
+
model = PeftModel.from_pretrained(base_model, "FFZwai/leyoai-flow-medium")
|
| 45 |
+
|
| 46 |
+
# Generate response
|
| 47 |
+
input_text = "Your question here"
|
| 48 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
| 49 |
+
outputs = model.generate(**inputs, max_length=512)
|
| 50 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
### Training Details
|
| 54 |
+
- **Base Model**: Qwen/Qwen2.5-3B-Instruct
|
| 55 |
+
- **LoRA Rank**: 16
|
| 56 |
+
- **Training Data**: 3,500 samples
|
| 57 |
+
- **Validation Data**: 175 samples
|
| 58 |
+
- **Framework**: QLoRA + SFTTrainer
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 中文
|
| 63 |
+
|
| 64 |
+
### 模型描述
|
| 65 |
+
增强版流程自动化和分类助手
|
| 66 |
+
|
| 67 |
+
### 安装方法
|
| 68 |
+
```bash
|
| 69 |
+
pip install transformers peft torch
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
### 使用场景
|
| 73 |
+
- 工作流分类
|
| 74 |
+
- 流程自动化
|
| 75 |
+
- 任务路由
|
| 76 |
+
|
| 77 |
+
### 使用方法
|
| 78 |
+
```python
|
| 79 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 80 |
+
from peft import PeftModel
|
| 81 |
+
|
| 82 |
+
# 加载基座模型
|
| 83 |
+
base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
|
| 84 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-3B-Instruct")
|
| 85 |
+
|
| 86 |
+
# 加载 LoRA 适配器
|
| 87 |
+
model = PeftModel.from_pretrained(base_model, "FFZwai/leyoai-flow-medium")
|
| 88 |
|
| 89 |
+
# 生成回复
|
| 90 |
+
input_text = "你的问题"
|
| 91 |
+
inputs = tokenizer(input_text, return_tensors="pt")
|
| 92 |
+
outputs = model.generate(**inputs, max_length=512)
|
| 93 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 94 |
```
|
| 95 |
+
|
| 96 |
+
### 训练细节
|
| 97 |
+
- **基座模型**: Qwen/Qwen2.5-3B-Instruct
|
| 98 |
+
- **LoRA Rank**: 16
|
| 99 |
+
- **训练数据**: 3,500 samples
|
| 100 |
+
- **验证数据**: 175 samples
|
| 101 |
+
- **训练框架**: QLoRA + SFTTrainer
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## About LeyoAI
|
| 106 |
+
|
| 107 |
+
LeyoAI is an AI MaaS platform by 杭州市上城区乐友信息服务工作室, providing specialized AI assistants for cybersecurity, video safety, workflow automation, and data analytics.
|
| 108 |
+
|
| 109 |
+
**Website**: https://leyoai.vercel.app
|