-
Notifications
You must be signed in to change notification settings - Fork 182
修正一些拼写错误。 #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
修正一些拼写错误。 #268
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,7 +100,7 @@ def load( | |
| # instruct = True if "-Instruct" in str(model_dir) else False | ||
| instruct = True | ||
|
|
||
| with open(model_dir / "cosyvoice.yaml", "r") as f: | ||
| with open(model_dir / "cosyvoice2.yaml", "r") as f: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 需要兼容老路径,因为这是模型提供上游修改文件名导致,所以历史文件应该还是老的名字也就是 还有这里应该涉及到下载脚本需要同步修改: |
||
| configs = load_hyperpyyaml(f, overrides=self.hp_overrides) | ||
|
|
||
| frontend = CosyVoiceFrontEnd( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,7 +63,7 @@ def download_models( | |
| self, | ||
| source: Literal["huggingface", "local", "custom"] = "local", | ||
| force_redownload=False, | ||
| custom_path: Optional[torch.serialization.FILE_LIKE] = None, | ||
| custom_path: Optional[torch.serialization.FileLike] = None, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 首先,这里应该是 torch 版本差异导致,我不太希望升级这个库的 torch 版本,可能带来意料之外的问题,很多默认值可能变成需要配置的项 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 所以,如果你确实需要升级 torch,请把 FileLike 这个类型引入到我们的代码中 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个不是什么大问题,确实是torch版本差异造成的。nvidia 50xx系显卡采用了新的架构,因此cuda要求12.8以上,而torch官方支持cuda12.8的版本是从2.7.0开始的,我只是无奈被动选择了这个版本V2.7.1。 |
||
| ) -> Optional[str]: | ||
| if source == "local": | ||
| download_path = os.getcwd() | ||
|
|
@@ -121,7 +121,7 @@ def load( | |
| source: Literal["huggingface", "local", "custom"] = "local", | ||
| force_redownload=False, | ||
| compile: bool = False, | ||
| custom_path: Optional[torch.serialization.FILE_LIKE] = None, | ||
| custom_path: Optional[torch.serialization.FileLike] = None, | ||
| device: Optional[torch.device] = None, | ||
| coef: Optional[torch.Tensor] = None, | ||
| use_flash_attn=False, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
|
|
||
| fast_langdetect.infer._default_detector = fast_langdetect.infer.LangDetector( | ||
| fast_langdetect.infer.LangDetectConfig( | ||
| cache_dir=Path(__file__).parent.parent.parent / "pretrained_models" / "fast_langdetect" | ||
| cache_dir="models/gpt_sovits_v4/fast_langdetect" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 同上,我不太希望修改 repos_static 下面的代码逻辑,会徒增维护难度,以及会给后续同步上游代码带来困难 |
||
| ) | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个功能对于需要 web 端使用 api 的用户很重要,不应该直接删除
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢回应。我曾怀疑是fastapi版本问题,但检查版本和推荐版本一致。应该是初始化逻辑造成的,和环境升级到torch2.7无关。容器运行到这个错误就终止了,需要一个解决方案来运行。
命令行参数:python3 webui.py --api --webui_experimental
完整的错误提示:
`
2025-07-30 18:34:12,421 - datasets - INFO - PyTorch version 2.7.1+cu128 available.
2025-07-30 18:34:13,653 - modules.core.models.tts.CosyVoiceModel - INFO - Found CosyVoice model: [PosixPath('models/CosyVoice2-0.5B')]
2025-07-30 18:34:13,723 - modules.devices.devices - INFO - Using half precision: torch.float16
2025-07-30 18:34:13,753 - modules.devices.devices - INFO - Using device: cuda
2025-07-30 18:34:13,754 - modules.webui.app - INFO - WebUI module initialized
2025-07-30 18:34:13,754 - modules.webui.localization - INFO - Loaded localization file /app/Speech-AI-Forge/language/zh-CN.json
2025-07-30 18:34:14,071 - httpx - INFO - HTTP Request: GET https://checkip.amazonaws.com/ "HTTP/1.1 200 "
Running on local URL: http://0.0.0.0:7860
2025-07-30 18:34:14,118 - httpx - INFO - HTTP Request: GET http://localhost:7860/startup-events "HTTP/1.1 200 OK"
2025-07-30 18:34:14,153 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
To create a public link, set
share=Trueinlaunch().2025-07-30 18:34:14,155 - modules.api.Api - INFO - Registered API: GET /v1/ping
2025-07-30 18:34:14,155 - modules.api.Api - INFO - Registered API: GET /v1/versions
2025-07-30 18:34:14,155 - modules.api.Api - INFO - Registered API: GET /v1/audio_formats
2025-07-30 18:34:14,156 - modules.api.Api - INFO - Registered API: GET /v1/models/reload
2025-07-30 18:34:14,156 - modules.api.Api - INFO - Registered API: GET /v1/models/unload
2025-07-30 18:34:14,156 - modules.api.Api - INFO - Registered API: GET /v1/models/list
2025-07-30 18:34:14,156 - modules.api.Api - INFO - Registered API: GET /v1/styles/list
2025-07-30 18:34:14,157 - modules.api.Api - INFO - Registered API: GET /v1/speakers/list
2025-07-30 18:34:14,157 - modules.api.Api - INFO - Registered API: POST /v1/speakers/refresh
2025-07-30 18:34:14,158 - modules.api.Api - INFO - Registered API: POST /v1/speakers/update
2025-07-30 18:34:14,158 - modules.api.Api - INFO - Registered API: POST /v1/speaker/create
2025-07-30 18:34:14,159 - modules.api.Api - INFO - Registered API: POST /v1/speaker/update
2025-07-30 18:34:14,159 - modules.api.Api - INFO - Registered API: POST /v1/speaker/detail
2025-07-30 18:34:14,162 - modules.api.Api - INFO - Registered API: GET /v1/tts
2025-07-30 18:34:14,162 - modules.api.Api - INFO - Registered API: POST /v1/ssml
2025-07-30 18:34:14,163 - modules.api.Api - INFO - Registered API: POST /v1/text:synthesize
2025-07-30 18:34:14,163 - modules.api.Api - INFO - Registered API: POST /v1/speech:recognize
2025-07-30 18:34:14,163 - modules.api.Api - INFO - Registered API: POST /v1/speech:longrunningrecognize
2025-07-30 18:34:14,163 - modules.api.Api - INFO - Registered API: POST /v1/audio/speech
2025-07-30 18:34:14,166 - modules.api.Api - INFO - Registered API: POST /v1/audio/transcriptions
2025-07-30 18:34:14,166 - modules.api.Api - INFO - Registered API: POST /v1/prompt/refine
2025-07-30 18:34:14,167 - modules.api.Api - INFO - Registered API: POST /v1/text/normalize
2025-07-30 18:34:14,167 - modules.api.impl.xtts_v2_api - INFO - Loaded xttsv2 config: {'stream_chunk_size': 100, 'temperature': 0.3, 'speed': 1, 'length_penalty': 0.5, 'repetition_penalty': 1.2, 'top_k': 20, 'top_p': 0.7, 'enable_text_splitting': True, 'batch_size': 4, 'eos': ' 。 ', 'infer_seed': 42, 'spliter_threshold': 100, 'model_name': 'cosy-voice', 'enable_enhancer': False}
2025-07-30 18:34:14,167 - modules.api.Api - INFO - Registered API: GET /v1/xtts_v2/speakers
2025-07-30 18:34:14,167 - modules.api.Api - INFO - Registered API: POST /v1/xtts_v2/tts_to_audio
2025-07-30 18:34:14,168 - modules.api.Api - INFO - Registered API: GET /v1/xtts_v2/tts_stream
2025-07-30 18:34:14,168 - modules.api.Api - INFO - Registered API: POST /v1/xtts_v2/set_tts_settings
2025-07-30 18:34:14,173 - modules.api.Api - INFO - Registered API: POST /v1/stt/transcribe
2025-07-30 18:34:14,176 - modules.api.Api - INFO - Registered API: POST /v1/stt/stream
2025-07-30 18:34:14,178 - modules.api.Api - INFO - Registered API: POST /v1/vc
2025-07-30 18:34:14,179 - modules.api.Api - INFO - Registered API: POST /v2/tts
2025-07-30 18:34:14,179 - modules.api.Api - INFO - Registered API: POST /v2/stt
Traceback (most recent call last):
File "/app/Speech-AI-Forge/webui.py", line 178, in
process_webui_args(args)
File "/app/Speech-AI-Forge/webui.py", line 156, in process_webui_args
process_api_args(args, app)
File "/app/Speech-AI-Forge/modules/api/api_setup.py", line 87, in process_api_args
api.set_cors(allow_origins=[cors_origin])
File "/app/Speech-AI-Forge/modules/api/Api.py", line 101, in set_cors
@self.app.middleware("http")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/lib/python3.11/site-packages/fastapi/applications.py", line 4535, in decorator
self.add_middleware(BaseHTTPMiddleware, dispatch=func)
File "/opt/conda/lib/python3.11/site-packages/starlette/applications.py", line 141, in add_middleware
raise RuntimeError("Cannot add middleware after an application has started")
RuntimeError: Cannot add middleware after an application has started
2025-07-30 18:34:14,889 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-07-30 18:34:14,893 - httpx - INFO - HTTP Request: GET https://api.gradio.app/gradio-messaging/en "HTTP/1.1 200 OK"
`