Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
whisper-asr-webservice
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Schwertgen
whisper-asr-webservice
Commits
e38082e9
Commit
e38082e9
authored
2 months ago
by
Subliminal Guy
Browse files
Options
Downloads
Patches
Plain Diff
Add More Subtle Way to query trancription status
parent
f8f7a28c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/asr_models/asr_model.py
+17
-0
17 additions, 0 deletions
app/asr_models/asr_model.py
app/webservice.py
+2
-1
2 additions, 1 deletion
app/webservice.py
with
19 additions
and
1 deletion
app/asr_models/asr_model.py
+
17
−
0
View file @
e38082e9
...
...
@@ -75,3 +75,20 @@ class ASRModel(ABC):
gc
.
collect
()
self
.
model
=
None
print
(
"
Model unloaded due to timeout
"
)
@property
def
is_transcribing
(
self
)
->
bool
:
"""
Returns True if a transcription is currently running.
"""
return
self
.
model_lock
.
locked
()
@property
def
is_model_loaded
(
self
)
->
bool
:
"""
Returns True if the model is loaded in memory.
"""
model_attr
=
self
.
model
if
isinstance
(
model_attr
,
dict
):
return
model_attr
.
get
(
'
whisperx
'
)
is
not
None
return
model_attr
is
not
None
This diff is collapsed.
Click to expand it.
app/webservice.py
+
2
−
1
View file @
e38082e9
...
...
@@ -125,7 +125,8 @@ async def transcription_status():
"""
Return whether a transcription is currently running.
"""
return
{
"
active
"
:
asr_model
.
transcription_active
}
# Use the model lock to check if a transcription is currently running
return
{
"
active
"
:
asr_model
.
is_transcribing
}
@click.command
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment