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
4f6d64d4
Commit
4f6d64d4
authored
Mar 08, 2026
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use download_model helper for audio pre-load with progress
parent
b622fe9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
62 deletions
+4
-62
coderai
coderai
+4
-62
No files found.
coderai
View file @
4f6d64d4
...
...
@@ -3631,38 +3631,9 @@ def main():
model_path = cached_path
print(f"
Using
cached
model
:
{
model_path
}
")
else:
# Download and cache
print(f"
Downloading
audio
model
:
{
model_to_use
}
")
import requests
import hashlib
# Download with progress
cache_dir = get_model_cache_dir()
url_path = model_to_use.split('?')[0]
filename = os.path.basename(url_path)
if not filename.endswith('.gguf'):
filename = "
whisper
-
model
.
gguf
"
url_hash = hashlib.sha256(model_to_use.encode()).hexdigest()
cached_filename = f"
{
url_hash
}
_
{
filename
}
"
model_path = os.path.join(cache_dir, cached_filename)
response = requests.get(model_to_use, stream=True)
response.raise_for_status()
total_size = int(response.headers.get('content-length', 0))
downloaded = 0
with open(model_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192*1024):
if chunk:
f.write(chunk)
downloaded += len(chunk)
if total_size > 0:
percent = (downloaded / total_size) * 100
print(f"
Downloaded
:
{
percent
:
.1f
}%
", end='
\r
')
print(f"
\
nDownloaded
and
cached
to
:
{
model_path
}
")
model_path = download_model(model_to_use, cache_dir)
model_to_use = model_path
# Load with llama.cpp (Vulkan)
...
...
@@ -3689,38 +3660,9 @@ def main():
model_path = cached_path
print(f"
Using
cached
model
:
{
model_path
}
")
else:
# Download and cache
print(f"
Downloading
audio
model
:
{
model_to_use
}
")
import requests
import hashlib
# Download with progress
cache_dir = get_model_cache_dir()
url_path = model_to_use.split('?')[0]
filename = os.path.basename(url_path)
if not filename.endswith('.bin') and not filename.endswith('.ggml'):
filename = "
whisper
-
model
.
bin
"
url_hash = hashlib.sha256(model_to_use.encode()).hexdigest()
cached_filename = f"
{
url_hash
}
_
{
filename
}
"
model_path = os.path.join(cache_dir, cached_filename)
response = requests.get(model_to_use, stream=True)
response.raise_for_status()
total_size = int(response.headers.get('content-length', 0))
downloaded = 0
with open(model_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192*1024):
if chunk:
f.write(chunk)
downloaded += len(chunk)
if total_size > 0:
percent = (downloaded / total_size) * 100
print(f"
Downloaded
:
{
percent
:
.1f
}%
", end='
\r
')
print(f"
\
nDownloaded
and
cached
to
:
{
model_path
}
")
model_path = download_model(model_to_use, cache_dir)
model_to_use = model_path
# Determine compute type
...
...
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