Skip to content

Commit

Permalink
bugfix closing model from autoservice and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelduranfrigola committed Jun 27, 2023
1 parent 0418282 commit d23c145
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

## Project Description

The Ersilia Model Hub is a unified platform of pre-trained AI/ML models for infectious and neglected disease research. The end goal is to provide an open-source, no-code solution to access AI/ML models to accelerate drug discovery. The models embedded in the hub include both models published in the literature (with appropriate third party acknowledgement) and models developed by the Ersilia team or contributors.
The Ersilia Model Hub is a unified platform of pre-trained AI/ML models for infectious and neglected disease research. The end goal is to provide an open-source, low-code solution to access AI/ML models for **drug discovery**. The models embedded in the hub include both models published in the literature (with appropriate third party acknowledgement) and models developed by the Ersilia team or contributors.

* Read more about the project in the [Ersilia Book](https://ersilia.gitbook.io/ersilia-book/)
* Browse available models in the [Ersilia Model Hub](https://ersilia.io/model-hub/)
Expand All @@ -29,7 +29,7 @@ Please check the package requirements in the [Installation Guide](https://ersili
1. Create a conda environment and activate it

```bash
conda create -n ersilia python=3.7
conda create -n ersilia python=3.10
conda activate ersilia
```

Expand Down Expand Up @@ -59,10 +59,10 @@ Please check the package requirements in the [Installation Guide](https://ersili
ersilia serve retrosynthetic-accessibility
```

1. And run the prediction **API**:
1. And **run** the model:

```bash
ersilia api -i my_molecules.csv -o my_predictions.csv
ersilia run -i my_molecules.csv -o my_predictions.csv
```

1. Finally, **close** the service when you are done.
Expand All @@ -71,6 +71,13 @@ Please check the package requirements in the [Installation Guide](https://ersili
ersilia close
```

1. If you no longer want to use the model, you can **delete** it.

```bash
ersilia delete retrosynthetic-accessibility
```


Please see the [Ersilia Book](https://ersilia.gitbook.io/ersilia-book/) for more examples and detailed explanations.

## Contribute
Expand Down
2 changes: 1 addition & 1 deletion ersilia/hub/bundle/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def is_docker(self, model_id):
if docker.exists(self.cfg.EXT.DOCKERHUB_ORG, img, tag):
return True
return False

def is_pulled_docker(self, model_id):
model_dir = os.path.join(self._model_path(model_id=model_id))
json_file = os.path.join(model_dir, IS_FETCHED_FROM_DOCKERHUB_FILE)
Expand Down
5 changes: 4 additions & 1 deletion ersilia/serve/autoservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ def close(self):
os.remove(tmp_file)
self.clean_temp_dir()
self.clean_docker_containers()
self.service.close()
try:
self.service.close()
except: # TODO: capture the error
pass

def api(
self, api_name, input, output=DEFAULT_OUTPUT, batch_size=DEFAULT_BATCH_SIZE
Expand Down

0 comments on commit d23c145

Please sign in to comment.