mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-15 12:24:48 +08:00
feat(gummy): 支持通过设置添加 API KEY
- 更新 main-gummy.py 以支持 API KEY 参数 - 修改 electron-builder.yml 以调整 Gummy 可执行文件路径
This commit is contained in:
@@ -4,6 +4,7 @@ from dashscope.audio.asr import (
|
||||
TranslationResult,
|
||||
TranslationRecognizerRealtime
|
||||
)
|
||||
import dashscope
|
||||
from datetime import datetime
|
||||
import json
|
||||
import sys
|
||||
@@ -77,7 +78,9 @@ class GummyTranslator:
|
||||
source: 源语言代码字符串(zh, en, ja 等)
|
||||
target: 目标语言代码字符串(zh, en, ja 等)
|
||||
"""
|
||||
def __init__(self, rate, source, target):
|
||||
def __init__(self, rate, source, target, api_key):
|
||||
if api_key:
|
||||
dashscope.api_key = api_key
|
||||
self.translator = TranslationRecognizerRealtime(
|
||||
model = "gummy-realtime-v1",
|
||||
format = "pcm",
|
||||
|
||||
Reference in New Issue
Block a user