Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
funasr_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f4bb99cf
authored
Mar 22, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]batch_size优化
1 parent
9303a192
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
funasr_service.py
mysql_service/funasr_db.py
funasr_service.py
View file @
f4bb99c
...
...
@@ -39,7 +39,7 @@ class FunasrService(object):
@timeit
def
transform
(
self
):
res
=
model
.
generate
(
input
=
self
.
path
,
batch_size_s
=
2
00
,
hotword
=
"""问界
\n
质保经理 80
\n
易损易耗件 80
\n
电瓶 80
\n
M5 80
res
=
model
.
generate
(
input
=
self
.
path
,
batch_size_s
=
1
00
,
hotword
=
"""问界
\n
质保经理 80
\n
易损易耗件 80
\n
电瓶 80
\n
M5 80
\n
M7 80
\n
M9 80
\n
石子 80
\n
橡胶棒 80
\n
电子助力泵 80
\n
电子真空助力泵 80
\n
充电桩 80
\n
密封圈 80
\n
4S店 80
\n
老化 80
"""
)
# print(res)
...
...
@@ -122,6 +122,8 @@ def fine_grained_transform_output(sentence_info):
output
.
append
(
model_output
(
one
[
"spk"
],
one
[
"start"
],
duration
,
one
[
"text"
])
.
to_dict
())
json_output
=
json
.
dumps
(
output
,
ensure_ascii
=
False
)
return
json_output
def
merge_spk_transform_output
(
sentence_info
):
output
=
[]
content
=
""
...
...
mysql_service/funasr_db.py
View file @
f4bb99c
...
...
@@ -35,7 +35,8 @@ def update_ali_asr_model_res(task_id: str, json_output: str, execute_time: int):
def
update_ali_asr_model_res_fail
(
task_id
:
str
,
exception
:
str
):
update_sql
=
(
f
"update ali_asr_model_res t set t.task_status = 2, t.exception_log =
%
s where t.task_id =
%
s;"
)
f
"update ali_asr_model_res t set t.task_status = 2, t.exception_log =
%
s,exception_limit = exception_limit + 1 "
f
"where t.task_id =
%
s;"
)
return
pool
.
update_one
(
update_sql
,
(
exception
,
task_id
,))
...
...
@@ -49,5 +50,5 @@ def select_ali_asr_model_res(task_id: str):
def
select_ali_asr_model_wait
():
select_sql
=
(
f
"select id,task_id,file_url,task_status,output_data from ali_asr_model_res aamr where aamr.del_flag = 0 and "
f
"aamr.output_data is null and aamr.task_status !=
%
s;"
)
f
"aamr.output_data is null and aamr.task_status !=
%
s
and exception_limit < 3
;"
)
return
pool
.
select_all
(
select_sql
,
1
)
Write
Preview
Markdown
is supported
Attach a file
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 post a comment