yuanflow-cli 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skills/yuanflow-skill//346/234/254/345/234/260/351/237/263/350/247/206/351/242/221/350/275/254/346/226/207/345/255/227/SKILL.md +24 -2
- package/skills/yuanflow-skill//346/234/254/345/234/260/351/237/263/350/247/206/351/242/221/350/275/254/346/226/207/345/255/227/scripts/requirements-transcribe.txt +2 -0
package/package.json
CHANGED
|
@@ -71,15 +71,23 @@ cd "<config.managed_skill_dir>\scripts"
|
|
|
71
71
|
在 `scripts/` 目录下创建虚拟环境并安装依赖:
|
|
72
72
|
|
|
73
73
|
```powershell
|
|
74
|
-
|
|
74
|
+
py -3.10 -m venv .venv
|
|
75
75
|
.\.venv\Scripts\python.exe -m pip install -r requirements-transcribe.txt
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
优先使用 Python 3.10,其次 3.11/3.12。不要优先使用 Python 3.13 或 3.14,因为 FunASR 依赖链里的部分包在这些版本上可能需要本地编译,容易出现 `editdistance` wheel build failed。Windows 上可以先运行 `py -0p` 查看可用版本。
|
|
79
|
+
|
|
80
|
+
`requirements-transcribe.txt` 必须包含 `funasr`、`modelscope`、`torch` 和 `torchaudio`。如果导入 `funasr` 时提示 `No module named 'torch'` 或 `No module named 'torchaudio'`,先补齐缺失依赖,再重新执行转写。
|
|
81
|
+
|
|
78
82
|
视频转音频需要本机可用 `ffmpeg`。如果用户给的是视频且系统找不到 `ffmpeg`,先明确报告缺少 ffmpeg,不要伪造转写结果。
|
|
79
83
|
|
|
80
84
|
## 推荐调用方式
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
统一入口脚本。
|
|
87
|
+
|
|
88
|
+
如果是在 YuanFlow 的 `execute_shell_command` 中执行,命令会先经过 Windows `cmd.exe`。当 Skill 目录或输入文件路径包含中文时,优先使用 PowerShell `-EncodedCommand`,避免中文路径被转义成 `\uXXXX` 后找不到目录。
|
|
89
|
+
|
|
90
|
+
普通 PowerShell 里可以直接运行:
|
|
83
91
|
|
|
84
92
|
```powershell
|
|
85
93
|
cd "<Skill目录>\scripts"
|
|
@@ -93,6 +101,20 @@ cd "<Skill目录>\scripts"
|
|
|
93
101
|
.\.venv\Scripts\python.exe .\transcribe_media.py "C:\path\to\input.mp4"
|
|
94
102
|
```
|
|
95
103
|
|
|
104
|
+
YuanFlow Agent 工具调用时推荐生成 UTF-16LE base64 后执行:
|
|
105
|
+
|
|
106
|
+
```powershell
|
|
107
|
+
$script = "Set-Location -LiteralPath '<Skill目录>\scripts'; .\.venv\Scripts\python.exe .\transcribe_media.py 'C:\path\to\input.mp3'"
|
|
108
|
+
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($script))
|
|
109
|
+
powershell -NoProfile -ExecutionPolicy Bypass -EncodedCommand $encoded
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
如果尚未创建虚拟环境,把 `$script` 改成:
|
|
113
|
+
|
|
114
|
+
```powershell
|
|
115
|
+
Set-Location -LiteralPath '<Skill目录>\scripts'; if (-not (Test-Path -LiteralPath '.\.venv\Scripts\python.exe')) { py -3.10 -m venv .venv }; .\.venv\Scripts\python.exe -m pip install -r requirements-transcribe.txt; .\.venv\Scripts\python.exe .\transcribe_media.py 'C:\path\to\input.mp3'
|
|
116
|
+
```
|
|
117
|
+
|
|
96
118
|
常用参数:
|
|
97
119
|
|
|
98
120
|
| 参数 | 说明 |
|