-
-
Notifications
You must be signed in to change notification settings - Fork 239
Open
Description
when using fast api http.
I get this when using STT_MODEL = "mlx-community/parakeet-tdt-0.6b-v2"
Fetching 4 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 49200.05it/s]
INFO: 127.0.0.1:65120 - "POST /v1/audio/transcriptions HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File ".pixi/envs/default/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
result = await app( # type: ignore[func-returns-value]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/fastapi/applications.py", line 1134, in __call__
await super().__call__(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/applications.py", line 107, in __call__
await self.middleware_stack(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
raise exc
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
await self.app(scope, receive, _send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
await self.app(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File ".pixi/envs/default/lib/python3.12/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
await self.middleware_stack(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
await route.handle(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
await self.app(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 125, in app
await wrap_app_handling_exceptions(app, request)(scope, receive, send)
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File ".pixi/envs/default/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File ".pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 111, in app
response = await f(request)
^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 391, in app
raw_response = await run_endpoint_function(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/fastapi/routing.py", line 290, in run_endpoint_function
return await dependant.call(**values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/mlx_audio/server.py", line 232, in stt_transcriptions
stt_model = model_provider.load_model(model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/mlx_audio/server.py", line 35, in load_model
self.models[model_name] = load_model(model_name)
^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/mlx_audio/utils.py", line 63, in load_model
model_category = get_model_category(model_type, model_name_parts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pixi/envs/default/lib/python3.12/site-packages/mlx_audio/utils.py", line 28, in get_model_category
if importlib.util.find_spec(module_path) is not None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
workaround
utils.py inside get_model_category:
- if importlib.util.find_spec(module_path) is not None:
- return category
+ try:
+ if importlib.util.find_spec(module_path) is not None:
+ return category
+ except ModuleNotFoundError:
+ continueMetadata
Metadata
Assignees
Labels
No labels