Skip to content

Commit

Permalink
last typing changes and merge update
Browse files Browse the repository at this point in the history
  • Loading branch information
Christina Bukas committed Mar 13, 2024
1 parent 219931e commit 4cbad70
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/client/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include dcp_client/*.cfg
include dcp_client/*.yaml
4 changes: 2 additions & 2 deletions src/client/dcp_client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def main():

if args.mode == "local":
server_config = read_config(
"server", config_path=path.join(dir_name, "config.cfg")
"server", config_path=path.join(dir_name, "config.yaml")
)
elif args.mode == "remote":
server_config = read_config(
"server", config_path=path.join(dir_name, "config_remote.cfg")
"server", config_path=path.join(dir_name, "config_remote.yaml")
)

image_storage = FilesystemImageStorage()
Expand Down
8 changes: 4 additions & 4 deletions src/client/dcp_client/utils/bentoml_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ def is_connected(self) -> bool:
"""
return bool(self.client)

async def _run_train(self, data_path: str):
async def _run_train(self, data_path: str) -> Optional[str]:
"""Runs the training task asynchronously.
:param data_path: Path to the training data.
:type data_path: str
:return: Response from the server if successful, None otherwise.
:rtype: str, or None
"""
try:
response = await self.client.async_train(data_path)
print('kkkkkkkkkkkkkkkkkkkkk', type(response))
return response
except BentoMLException:
return None
Expand All @@ -66,16 +66,16 @@ def run_train(self, data_path: str):
"""
return asyncio.run(self._run_train(data_path))

async def _run_inference(self, data_path: str):
async def _run_inference(self, data_path: str) -> Optional[np.ndarray]:
"""Runs the inference task asynchronously.
:param data_path: Path to the data for inference.
:type data_path: str
:return: List of files not supported by the server if unsuccessful, otherwise returns None.
:rtype: np.ndarray, or None
"""
try:
response = await self.client.async_segment_image(data_path)
print('jjjjjjjjjj', type(response))
return response
except BentoMLException:
return None
Expand Down
2 changes: 1 addition & 1 deletion src/server/dcp_server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"min_train_masks": 1
},
"classifier":{
"n_epochs": 100,
"n_epochs": 20,
"lr": 0.001,
"batch_size": 1,
"optimizer": "Adam"
Expand Down

0 comments on commit 4cbad70

Please sign in to comment.