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
Hide 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,49 @@ def main():
...
@@ -3613,17 +3613,49 @@ def main():
if should_preload:
if should_preload:
print(f"
Pre
-
loading
audio
model
...
")
print(f"
Pre
-
loading
audio
model
...
")
try:
try:
# Try faster-whisper first (requires torch)
from faster_whisper import WhisperModel
import torch
model_to_use = args.audio_model
model_to_use = args.audio_model
model_path = None
model_path = None
# Check if model is a GGUF file - use llama.cpp (Vulkan) instead of faster-whisper
# Check if model is a URL - handle caching
is_gguf = model_to_use.endswith('.gguf') or '.gguf?' in model_to_use or 'gguf' in model_to_use.lower()
if model_to_use.startswith('http://') or model_to_use.startswith('https://'):
cached_path = get_cached_model_path(model_to_use)
if cached_path:
model_path = cached_path
print(f"
Using
cached
model
:
{
model_path
}
")
else:
# Download with progress
cache_dir = get_model_cache_dir()
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
)
# 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
(
faster
-
whisper
)
")
if is_gguf:
except ImportError:
# Use llama.cpp for GGUF audio models (works with Vulkan)
# faster-whisper not available, try GGUF with llama.cpp
print(f"
Using
GGUF
format
with
llama
.
cpp
(
Vulkan
)...
")
print("
faster
-
whisper
not
available
,
trying
GGUF
with
llama
.
cpp
...
")
try:
from llama_cpp import Llama
from llama_cpp import Llama
model_to_use = args.audio_model
model_path = None
# Check if model is a URL - handle caching
# Check if model is a URL - handle caching
if model_to_use.startswith('http://') or model_to_use.startswith('https://'):
if model_to_use.startswith('http://') or model_to_use.startswith('https://'):
cached_path = get_cached_model_path(model_to_use)
cached_path = get_cached_model_path(model_to_use)
...
@@ -3648,42 +3680,14 @@ def main():
...
@@ -3648,42 +3680,14 @@ def main():
model_key = f"
audio
:{
args
.
audio_model
}
"
model_key = f"
audio
:{
args
.
audio_model
}
"
multi_model_manager.add_model(model_key, audio_model)
multi_model_manager.add_model(model_key, audio_model)
print(f"
Audio
model
loaded
successfully
(
GGUF
/
Vulkan
)
")
print(f"
Audio
model
loaded
successfully
(
GGUF
/
Vulkan
)
")
else:
# Use faster-whisper for non-GGUF models
from faster_whisper import WhisperModel
import torch
# 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)
if cached_path:
model_path = cached_path
print(f"
Using
cached
model
:
{
model_path
}
")
else:
# Download with progress
cache_dir = get_model_cache_dir()
model_path = download_model(model_to_use, cache_dir)
model_to_use = model_path
# Determine compute type
except Exception as e:
compute_type = "
float16
" if torch.cuda.is_available() else "
int8
"
print(f"
Warning
:
Could
not
pre
-
load
audio
model
:
{
e
}
")
import traceback
# Load the model
traceback.print_exc()
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, whisper_model)
print(f"
Audio
model
loaded
successfully
")
except Exception as e:
except Exception as e:
print(f"
Warning
:
Could
not
pre
-
load
audio
model
:
{
e
}
")
print(f"
Warning
:
Could
not
pre
-
load
audio
model
:
{
e
}
")
import traceback
traceback.print_exc()
# Set up TTS model if specified
# Set up TTS model if specified
if args.tts_model:
if 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