Skip to content

Commit a2afa7e

Browse files
authored
Merge pull request #22 from rekcurd/fix/update-doc-for-v1.0.0
Merged
2 parents e214b8d + 8cf668b commit a2afa7e

2 files changed

Lines changed: 10 additions & 33 deletions

File tree

README.md

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ https://github.com/rekcurd/community
1515
## Components
1616
- [Rekcurd](https://github.com/rekcurd/rekcurd-python): Project for serving ML module.
1717
- [Rekcurd-dashboard](https://github.com/rekcurd/dashboard): Project for managing ML model and deploying ML module.
18-
- [Rekcurd-client](https://github.com/rekcurd/python-client) (here): Project for integrating ML module.
18+
- [Rekcurd-client](https://github.com/rekcurd/python-client): Project for integrating ML module.
1919

2020

2121
## Installation
@@ -34,33 +34,15 @@ pip install rekcurd_client
3434
```
3535

3636
## How to use
37-
Example code is available [here](https://github.com/rekcurd/rekcurd-client-example). When you use Kubernetes and Rekcurd dashboard, you need to specify `application_name`, `service_level` and `rekcurd_grpc_version` correctly.
38-
39-
```python
40-
from rekcurd_client import RekcurdWorkerClient
41-
42-
43-
host = 'localhost'
44-
port = 5000
45-
application_name = "sample"
46-
service_level = "development"
47-
rekcurd_grpc_version = "v2"
48-
49-
client = RekcurdWorkerClient(
50-
host=host, port=port,
51-
application_name=application_name, service_level=service_level, rekcurd_grpc_version=rekcurd_grpc_version)
52-
53-
idata = [0,0,0,1,11,0,0,0,0,0,
54-
0,7,8,0,0,0,0,0,1,13,
55-
6,2,2,0,0,0,7,15,0,9,
56-
8,0,0,5,16,10,0,16,6,0,
57-
0,4,15,16,13,16,1,0,0,0,
58-
0,3,15,10,0,0,0,0,0,2,
59-
16,4,0,0]
60-
response = client.run_predict_arrint_string(idata)
37+
Example is available [here](https://github.com/rekcurd/rekcurd-client-example).
38+
39+
40+
## Unittest
41+
```
42+
$ python -m unittest
6143
```
6244

63-
### RekcurdWorkerClient
45+
## Method definition
6446
You need to use an appropriate method for your Rekcurd service. The methods are generated according to the input and output formats. *V* is the length of feature vector. *M* is the number of classes. If your algorithm is a binary classifier, you set *M* to 1. If your algorithm is a multi-class classifier, you set *M* to the number of classes.
6547

6648
|method |input: data<BR>(required) |input: option |output: label<BR>(required) |output: score<BR>(required) |output: option |
@@ -96,9 +78,3 @@ The input "option" field needs to be a json format. Any style is Ok but we have
9678
|Field |Type |Description |
9779
|:---|:---|:---|
9880
|suppress_log_input |bool |True: NOT print the input and output to the log message. <BR>False (default): Print the input and output to the log message.
99-
100-
101-
## Unittest
102-
```
103-
$ python -m unittest
104-
```

test/core/test_worker_client_e2e.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from functools import wraps
99
from unittest.mock import patch, Mock
1010

11+
from rekcurd import RekcurdPack
1112
from rekcurd.utils import PredictResult
1213

1314

@@ -81,7 +82,7 @@ def assertArrStringResponse(self, response):
8182
def setUpClass(cls):
8283
server = grpc.server(futures.ThreadPoolExecutor(max_workers=1))
8384
rekcurd_pb2_grpc.add_RekcurdWorkerServicer_to_server(
84-
RekcurdWorkerServicer(app=app, predictor=None), server)
85+
RekcurdWorkerServicer(RekcurdPack(app, None)), server)
8586
server.add_insecure_port("[::]:5000")
8687
server.start()
8788
cls.server = server

0 commit comments

Comments
 (0)