[X] This template is only for bug reports. For questions, please visit Discussions.
[X] I have thoroughly reviewed the project documentation (installation, training, inference) but couldn't find information to solve my problem. English中文日本語Portuguese (Brazil)
[X] I have searched for existing issues, including closed ones. Search issues
[X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
[X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
[X] Please do not modify this template and fill in all required fields.
Cloud or Self Hosted
Self Hosted (Source)
Environment Details
running on debian 12 with cuda 12.4
launched via python tools/api.py
Steps to Reproduce
run the api server
try to post /v1/asr with
from tools.schema import ServeASRRequest
import requests
import ormsgpack
def audio_to_bytes(file_path):
with open(file_path, "rb") as wav_file:
wav = wav_file.read()
return wav
request_data = ormsgpack.packb(
pydantic_data, option=ormsgpack.OPT_SERIALIZE_PYDANTIC
)
max_retries = 2
for attempt in range(max_retries):
try:
response = requests.post(
base_url,
data=request_data,
stream=True,
headers={
"Content-Type": "application/msgpack"
}
)
if response.status_code == 200:
response_data = response.content
try:
asr_response = ormsgpack.unpackb(
response_data, use_list=False)
print("ASR Response:", asr_response)
except Exception as e:
print("Failed to decode response content:", e)
print("Raw Response Content:", response_data)
else:
print(
f"Failed to get a successful response from ASR service. Status code: {response.status_code}")
print("Response content:", response.content)
except Exception as e:
print(f"An error occurred during the request: {e}")
if name == 'main':
audio_path = './examples/8913957783621352198.wav'
base_url = 'http://127.0.0.1:8080/v1/asr'
fish_asr(base_url, audio_path)
from client side error message
```log
Failed to get a successful response from ASR service. Status code: 500
Response content: b'{"statusCode":500,"message":"name \'asr_model\' is not defined","error":"Internal Server Error"}'
Failed to get a successful response from ASR service. Status code: 500
Response content: b'{"statusCode":500,"message":"name \'asr_model\' is not defined","error":"Internal Server Error"}'
from api side, the error
Traceback (most recent call last):
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper
return await endpoint()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper
return await function()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params
result = callback(*args, **{**keyword_params, **kwargs})
File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr
asr_model, audios=audios, sr=payload.sample_rate, language=payload.language
NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'?
INFO: 127.0.0.1:44974 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error
Traceback (most recent call last):
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper
return await endpoint()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper
return await function()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params
result = callback(*args, **{**keyword_params, **kwargs})
File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr
asr_model, audios=audios, sr=payload.sample_rate, language=payload.language
NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'?
INFO: 127.0.0.1:44980 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error
Traceback (most recent call last):
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper
return await endpoint()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper
return await function()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params
result = callback(*args, **{**keyword_params, **kwargs})
File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr
asr_model, audios=audios, sr=payload.sample_rate, language=payload.language
NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'?
INFO: 127.0.0.1:47604 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error
Traceback (most recent call last):
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper
return await endpoint()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper
return await function()
File "Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params
result = callback(*args, **{**keyword_params, **kwargs})
File /Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr
asr_model, audios=audios, sr=payload.sample_rate, language=payload.language
NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'?
INFO: 127.0.0.1:47616 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error
✔️ Expected Behavior
No response
❌ Actual Behavior
Traceback (most recent call last):
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper
return await endpoint()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper
return await function()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params
result = callback(*args, {keyword_params, *kwargs})
File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr
asr_model, audios=audios, sr=payload.sample_rate, language=payload.language
NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'?
INFO: 127.0.0.1:44974 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error
Traceback (most recent call last):
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper
return await endpoint()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper
return await function()
File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params
result = callback(args, {keyword_params, **kwargs})
File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr
asr_model, audios=audios, sr=payload.sample_rate, language=payload.language
NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'?
INFO: 127.0.0.1:44980 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error
Self Checks
Cloud or Self Hosted
Self Hosted (Source)
Environment Details
running on debian 12 with cuda 12.4 launched via
python tools/api.py
Steps to Reproduce
/v1/asr
withdef audio_to_bytes(file_path): with open(file_path, "rb") as wav_file: wav = wav_file.read() return wav
def fish_asr(base_url, audio_path): audio_bytes = audio_to_bytes(audio_path) data = { "audios": [audio_bytes], "language": "zh", "ignore_timestamps": "False", } pydantic_data = ServeASRRequest(**data)
if name == 'main': audio_path = './examples/8913957783621352198.wav' base_url = 'http://127.0.0.1:8080/v1/asr' fish_asr(base_url, audio_path)
from api side, the error
✔️ Expected Behavior
No response
❌ Actual Behavior
Traceback (most recent call last): File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper return await endpoint() File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper return await function() File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params result = callback(*args, {keyword_params, *kwargs}) File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr asr_model, audios=audios, sr=payload.sample_rate, language=payload.language NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'? INFO: 127.0.0.1:44974 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error Traceback (most recent call last): File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/exceptions.py", line 27, in wrapper return await endpoint() File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/views.py", line 29, in wrapper return await function() File "/Apps/fish-speech/venv/lib/python3.10/site-packages/kui/asgi/parameters.py", line 117, in callback_with_auto_bound_params result = callback(args, {keyword_params, **kwargs}) File "/Apps/fish-speech/tools/api.py", line 369, in api_invoke_asr asr_model, audios=audios, sr=payload.sample_rate, language=payload.language NameError: name 'asr_model' is not defined. Did you mean: 'vad_model'? INFO: 127.0.0.1:44980 - "POST /v1/asr HTTP/1.1" 500 Internal Server Error