Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
bom_identify
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9045bdce
authored
May 27, 2020
by
lichenggang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
serve log
parent
e77fb05c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
classify_grpc_server.py → classify_server.py
classify_
grpc_
server.py
→
classify_server.py
View file @
9045bdce
...
...
@@ -6,14 +6,17 @@ from protobuf import classify_pb2_grpc
from
utils.config
import
model_config
from
utils.predic_fac
import
PredictorFac
from
utils.log_manager
import
get_logger
log_server
=
get_logger
(
'server'
)
class
Classify
(
classify_pb2_grpc
.
classifyServicer
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
()
.
__init__
(
*
args
,
**
kwargs
)
log_server
.
info
(
'classify server start!'
)
self
.
predictorfac
=
PredictorFac
(
model_config
)
def
SingleClassify
(
self
,
request
,
context
):
log_server
.
debug
(
'接收数据: '
+
request
.
keyword
)
res
=
self
.
predictorfac
.
predic
(
request
.
keyword
)
return
classify_pb2
.
SingleClassifyReply
(
message
=
'result {msg}'
.
format
(
msg
=
res
))
...
...
@@ -37,4 +40,4 @@ def serve():
if
__name__
==
'__main__'
:
serve
()
print
(
Classify
()
.
fac_test_predic
(
'lm358'
))
#
print(Classify().fac_test_predic('lm358'))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment