Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asr-benchmarks
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcin Wątroba
asr-benchmarks
Commits
cd69e09a
Unverified
Commit
cd69e09a
authored
3 years ago
by
Marcin Wątroba
Browse files
Options
Downloads
Patches
Plain Diff
Add port to base service
parent
817fcd7a
Branches
Branches containing commit
1 merge request
!10
Feature/add auth asr service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sziszapangma/integration/base_asr_service/asr_processor.py
+5
-2
5 additions, 2 deletions
sziszapangma/integration/base_asr_service/asr_processor.py
with
5 additions
and
2 deletions
sziszapangma/integration/base_asr_service/asr_processor.py
+
5
−
2
View file @
cd69e09a
...
...
@@ -11,13 +11,15 @@ from flask_httpauth import HTTPTokenAuth
from
sziszapangma.integration.base_asr_service.asr_result
import
AsrResult
_TEMP_DIRECTORY
=
"
asr_processing
"
_AUTH_TOKEN
=
'
AUTH_TOKEN
'
_SERVICE_PORT
=
'
SERVICE_PORT
'
class
AsrProcessor
(
ABC
):
user_token
:
str
def
__init__
(
self
):
self
.
user_token
=
os
.
environ
[
"
AUTH_TOKEN
"
]
self
.
user_token
=
os
.
environ
[
_
AUTH_TOKEN
]
@abstractmethod
def
process_asr
(
self
,
audio_file_path
:
str
)
->
AsrResult
:
...
...
@@ -61,4 +63,5 @@ class AsrProcessor(ABC):
Path
(
_TEMP_DIRECTORY
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
app
.
route
(
"
/process_asr
"
,
methods
=
[
"
POST
"
])(
auth
.
login_required
(
self
.
process_request
))
app
.
route
(
"
/health_check
"
,
methods
=
[
"
GET
"
])(
self
.
health_check
)
app
.
run
(
debug
=
True
,
host
=
"
0.0.0.0
"
)
port
=
int
(
os
.
environ
[
_SERVICE_PORT
])
if
_SERVICE_PORT
in
os
.
environ
else
5000
app
.
run
(
debug
=
True
,
host
=
"
0.0.0.0
"
,
port
=
port
)
This diff is collapsed.
Click to expand it.
Preview
0%
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