Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
coderai
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
coderai
Commits
71b9572c
Commit
71b9572c
authored
Mar 19, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add whisper-server initialization to main.py
parent
c6e0dc7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
main.py
codai/main.py
+34
-0
No files found.
codai/main.py
View file @
71b9572c
...
@@ -365,6 +365,40 @@ def main():
...
@@ -365,6 +365,40 @@ def main():
'offload'
:
args
.
audio_offload
,
'offload'
:
args
.
audio_offload
,
})
})
# Set up whisper-server if specified
if
args
.
whisper_server
:
print
(
f
"
\n
Whisper server: {args.whisper_server}"
)
print
(
f
" Port: {args.whisper_server_port}"
)
# Import WhisperServerManager
from
codai.models.manager
import
WhisperServerManager
# Check if whisper-server is already running
if
multi_model_manager
.
whisper_server
is
None
:
whisper_server_mgr
=
WhisperServerManager
(
server_path
=
args
.
whisper_server
,
port
=
args
.
whisper_server_port
)
multi_model_manager
.
whisper_server
=
whisper_server_mgr
else
:
whisper_server_mgr
=
multi_model_manager
.
whisper_server
print
(
"Whisper server already running, using existing instance"
)
# Start whisper-server if we have audio_models configured
if
audio_models
:
model_to_use
=
audio_models
[
0
]
if
audio_models
else
None
gpu_device
=
getattr
(
args
,
'audio_vulkan_device'
,
0
)
or
0
print
(
f
"DEBUG: Starting whisper-server with gpu_device={gpu_device}"
)
actual_model_path
=
whisper_server_mgr
.
start
(
model_path
=
model_to_use
,
gpu_device
=
gpu_device
)
if
actual_model_path
:
# Update audio_models in multi_model_manager to store the actual path (not the URL)
if
model_to_use
!=
actual_model_path
:
if
multi_model_manager
.
audio_models
and
multi_model_manager
.
audio_models
[
0
]
==
model_to_use
:
multi_model_manager
.
audio_models
[
0
]
=
actual_model_path
print
(
f
"Whisper server started with model: {actual_model_path}"
)
else
:
print
(
"Warning: Failed to start whisper-server, falling back to other backends"
)
# Set up image model if specified
# Set up image model if specified
if
image_models
:
if
image_models
:
print
(
f
"
\n
Image generation model(s): {image_models}"
)
print
(
f
"
\n
Image generation model(s): {image_models}"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment