princeton-ddss / blackfish

Machine learning as a service (MLaaS) for busy researchers
https://princeton-ddss.github.io/blackfish/
0 stars 0 forks source link

Add model download feature #24

Open cswaney opened 2 months ago

cswaney commented 2 months ago

This would allow users to download models to their home directory (the cache directory is assumed to be a shared, read-only location).

Essentially, this would just use huggingface_hub to download a model snapshot. The limitation is that we would only allow users to download model files locally, which is enough to allow users running through OnDemand to add new models, but somewhat annoying for users running the application on their laptop.

Users could (optionally) provide an access token, if needed, which could be provided as an environment variable or saved in a file in BLACKFISH_HOME_DIR.

This feature will implement API endpoints in order to provide access to the UI.

API

[POST] models/create - download a model and save to $BLACKFISH_HOME_DIR/models. [DELETE] models/delete - delete a model from $BLACKFISH_HOME_DIR/models.