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 49e6f3c8
authored
Mar 23, 2024
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]参数优化
1 parent
92a9f2ed
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
funasr_service.py
kafka_service/funasr_producer.py
funasr_service.py
View file @
49e6f3c
...
...
@@ -118,11 +118,10 @@ def deal_worker(task_id: str):
)
log
.
info
(
f
"Worker {task_id} finished."
)
except
Exception
as
e
:
log
.
error
(
f
"Worker error:{e}"
)
funasr_db
.
update_ali_asr_model_res_fail
(
task_id
,
str
(
e
),
traceback
.
format_exc
())
log
.
error
(
f
"Worker error{e}"
)
traceback
.
print_exc
()
kafka_service
.
funasr_producer
.
send_task_id
(
task_id
)
return
{
"Worker error"
:
str
(
e
)}
def
fine_grained_transform_output
(
sentence_info
):
...
...
kafka_service/funasr_producer.py
View file @
49e6f3c
import
json
import
traceback
import
uuid
from
log.logger
import
log
...
...
@@ -32,9 +33,14 @@ def send_wait_task():
def
send_task_id
(
task_id
:
str
):
try
:
data
=
{
"task_id"
:
task_id
}
message
=
json
.
dumps
(
data
)
.
encode
(
'utf-8'
)
producer
.
send
(
ConfigInfo
.
kafka_consumer_analysis_topic
,
message
)
print
(
f
"send success{task_id}"
)
log
.
info
(
f
"send success{task_id}"
)
except
Exception
as
e
:
log
.
info
(
f
"send task_id:{task_id} error:{traceback.format_exc()}"
)
finally
:
# 等待所有消息发送完成
producer
.
flush
()
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