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
bae50d66
Commit
bae50d66
authored
Mar 08, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try faster-whisper first for audio pre-load, fall back to GGUF
parent
4f6d64d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
38 deletions
+42
-38
coderai
coderai
+42
-38
No files found.
coderai
View file @
bae50d66
...
...
@@ -3613,17 +3613,13 @@ def main():
if should_preload:
print(f"
Pre
-
loading
audio
model
...
")
try:
# Try faster-whisper first (requires torch)
from faster_whisper import WhisperModel
import torch
model_to_use = args.audio_model
model_path = None
# Check if model is a GGUF file - use llama.cpp (Vulkan) instead of faster-whisper
is_gguf = model_to_use.endswith('.gguf') or '.gguf?' in model_to_use or 'gguf' in model_to_use.lower()
if is_gguf:
# Use llama.cpp for GGUF audio models (works with Vulkan)
print(f"
Using
GGUF
format
with
llama
.
cpp
(
Vulkan
)...
")
from llama_cpp import Llama
# Check if model is a URL - handle caching
if model_to_use.startswith('http://') or model_to_use.startswith('https://'):
cached_path = get_cached_model_path(model_to_use)
...
...
@@ -3636,22 +3632,29 @@ def main():
model_path = download_model(model_to_use, cache_dir)
model_to_use = model_path
# Load with llama.cpp (Vulkan)
audio_model = Llama(
model_path=model_to_use,
n_gpu_layers=-1, # All layers to GPU
n_ctx=2048,
verbose=False
# Determine compute type
compute_type = "
float16
" if torch.cuda.is_available() else "
int8
"
# Load the model
whisper_model = WhisperModel(
model_to_use,
device="
cuda
" if torch.cuda.is_available() else "
cpu
",
compute_type=compute_type
)
# Store in multi_model_manager
model_key = f"
audio
:{
args
.
audio_model
}
"
multi_model_manager.add_model(model_key, audio_model)
print(f"
Audio
model
loaded
successfully
(
GGUF
/
Vulkan
)
")
else:
# Use faster-whisper for non-GGUF models
from faster_whisper import WhisperModel
import torch
multi_model_manager.add_model(model_key, whisper_model)
print(f"
Audio
model
loaded
successfully
(
faster
-
whisper
)
")
except ImportError:
# faster-whisper not available, try GGUF with llama.cpp
print("
faster
-
whisper
not
available
,
trying
GGUF
with
llama
.
cpp
...
")
try:
from llama_cpp import Llama
model_to_use = args.audio_model
model_path = None
# Check if model is a URL - handle caching
if model_to_use.startswith('http://') or model_to_use.startswith('https://'):
...
...
@@ -3665,26 +3668,27 @@ def main():
model_path = download_model(model_to_use, cache_dir)
model_to_use = model_path
# Determine compute type
compute_type = "
float16
" if torch.cuda.is_available() else "
int8
"
# Load the model
whisper_model = WhisperModel(
model_to_use,
device="
cuda
" if torch.cuda.is_available() else "
cpu
",
compute_type=compute_type
# Load with llama.cpp (Vulkan)
audio_model = Llama(
model_path=model_to_use,
n_gpu_layers=-1, # All layers to GPU
n_ctx=2048,
verbose=False
)
# Store in multi_model_manager
model_key = f"
audio
:{
args
.
audio_model
}
"
multi_model_manager.add_model(model_key,
whisper
_model)
print(f"
Audio
model
loaded
successfully
")
multi_model_manager.add_model(model_key,
audio
_model)
print(f"
Audio
model
loaded
successfully
(
GGUF
/
Vulkan
)
")
except Exception as e:
print(f"
Warning
:
Could
not
pre
-
load
audio
model
:
{
e
}
")
import traceback
traceback.print_exc()
except Exception as e:
print(f"
Warning
:
Could
not
pre
-
load
audio
model
:
{
e
}
")
# Set up TTS model if specified
if args.tts_model:
print(f"
\
nText
-
to
-
speech
model
:
{
args
.
tts_model
}
")
...
...
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