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 4317ab80
authored
Mar 12, 2025
by
‘chizw’
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]限制优化
1 parent
31bf67f0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
3 deletions
config/config.py
config/config_beta.py
config/config_dev.py
config/config_release.py
config/config_test.py
kafka_service/funasr_consumer.py
kafka_service/test01.py
main.py
config/config.py
View file @
4317ab8
...
@@ -67,3 +67,4 @@ class ConfigInfo:
...
@@ -67,3 +67,4 @@ class ConfigInfo:
kafka_consumer_auto_offset_reset
=
Config
.
kafka_consumer_auto_offset_reset
kafka_consumer_auto_offset_reset
=
Config
.
kafka_consumer_auto_offset_reset
kafka_consumer_analysis_topic
=
Config
.
kafka_consumer_analysis_topic
kafka_consumer_analysis_topic
=
Config
.
kafka_consumer_analysis_topic
charset
=
Config
.
charset
charset
=
Config
.
charset
subprocess_count
=
Config
.
charset
config/config_beta.py
View file @
4317ab8
...
@@ -14,4 +14,5 @@ class Config:
...
@@ -14,4 +14,5 @@ class Config:
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
charset
=
'utf8'
charset
=
'utf8'
domain_mapping
=
{
'glsk-oss.oss-cn-shenzhen-internal.aliyuncs.com'
:
[
'glsk-oss.oss-cn-shenzhen.aliyuncs.com'
]}
domain_mapping
=
{
'glsk-oss.oss-cn-shenzhen-internal.aliyuncs.com'
:
[
'glsk-oss.oss-cn-shenzhen.aliyuncs.com'
]}
subprocess_count
=
1
#
#
config/config_dev.py
View file @
4317ab8
...
@@ -14,4 +14,5 @@ class Config:
...
@@ -14,4 +14,5 @@ class Config:
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
charset
=
'utf8'
charset
=
'utf8'
domain_mapping
=
{}
domain_mapping
=
{}
subprocess_count
=
1
#
#
config/config_release.py
View file @
4317ab8
...
@@ -19,3 +19,4 @@ class Config:
...
@@ -19,3 +19,4 @@ class Config:
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
charset
=
'utf8'
charset
=
'utf8'
domain_mapping
=
{
'glsk-oss.oss-cn-shenzhen-internal.aliyuncs.com'
:
[
'glsk-oss.oss-cn-shenzhen.aliyuncs.com'
]}
domain_mapping
=
{
'glsk-oss.oss-cn-shenzhen-internal.aliyuncs.com'
:
[
'glsk-oss.oss-cn-shenzhen.aliyuncs.com'
]}
subprocess_count
=
3
config/config_test.py
View file @
4317ab8
...
@@ -14,4 +14,5 @@ class Config:
...
@@ -14,4 +14,5 @@ class Config:
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
kafka_consumer_analysis_topic
=
'funasr_analysis_topic'
charset
=
'utf8'
charset
=
'utf8'
domain_mapping
=
{}
domain_mapping
=
{}
subprocess_count
=
2
#
#
kafka_service/funasr_consumer.py
View file @
4317ab8
...
@@ -80,7 +80,7 @@ def consume_kafka():
...
@@ -80,7 +80,7 @@ def consume_kafka():
try
:
try
:
# 先创建进程池,只复制当前资源
# 先创建进程池,只复制当前资源
# multiprocessing.set_start_method('spawn')
# multiprocessing.set_start_method('spawn')
process_pool
=
multiprocessing
.
Pool
(
processes
=
2
,
initializer
=
consumer_process_init
)
process_pool
=
multiprocessing
.
Pool
(
processes
=
ConfigInfo
.
subprocess_count
,
initializer
=
consumer_process_init
)
# m = multiprocessing.Manager()
# m = multiprocessing.Manager()
# q = m.JoinableQueue()
# q = m.JoinableQueue()
# # 加载大内存变量
# # 加载大内存变量
...
...
kafka_service/test01.py
View file @
4317ab8
...
@@ -155,8 +155,11 @@ def select_extract_data():
...
@@ -155,8 +155,11 @@ def select_extract_data():
# item.pop("recording_duration")
# item.pop("recording_duration")
time
.
sleep
(
3
)
time
.
sleep
(
3
)
for
row
in
data
:
for
row
in
data
:
print
(
f
"{row.get('id')}
\t
{row.get('employee_name')}
\t
{row.get('car_model')}
\t
"
# print(f"{row.get('id')}\t{row.get('employee_name')}\t{row.get('car_model')}\t"
f
"{row.get('bussiness_type')}
\t
{row.get('estimated_result')}
\t
{row.get('product')}
\t
{row.get('speed')}"
)
# f"{row.get('bussiness_type')}\t{row.get('estimated_result')}\t{row.get('product')}\t{row.get('speed')}")
print
(
f
"{row.get('id')}
\t
{row.get('recording_url')}
\t
{row.get('employee_name')}
\t
{row.get('car_model')}
\t
"
f
"{row.get('bussiness_type')}
\t
{row.get('estimated_result')}
\t
{row.get('speed')}"
)
# print(f"{row.get('speed')}")
pass
pass
return
data
return
data
...
...
main.py
View file @
4317ab8
...
@@ -58,6 +58,7 @@ def generate_random_filename():
...
@@ -58,6 +58,7 @@ def generate_random_filename():
@app.get
(
"/"
)
@app.get
(
"/"
)
def
hello_world
():
def
hello_world
():
print
(
"Hello World!"
)
return
"Hello World!"
return
"Hello World!"
@app.get
(
"/funasr/exit"
)
@app.get
(
"/funasr/exit"
)
...
...
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