-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.py
37 lines (31 loc) · 822 Bytes
/
client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import xmlrpc.client
import numpy as np
import sys
class MyClient:
def __init__(self):
server = xmlrpc.client.ServerProxy("http://localhost:8000")
self.server = server
def configure(self, config):
ret = self.server.config(config)
assert ret == 1
def get_zeros(self, num):
buff, dtype, shape = self.server.get_zeros(num)
return np.frombuffer(buff.data, dtype).reshape(shape)
def kill(self):
self.server.kill()
client = MyClient()
# print(client.get_zeros(50))
client.configure({
'datasets': [
{
'input': 'audio',
'output': 'embed',
'path': 'DS_WAV_VOCL',
}, {
'input': 'audio',
'output': 'embed',
'path': 'DS_WAV_INST',
}
]
})
client.kill()