kipoi / kipoi

Kipoi's model zoo API
https://kipoi.org/docs/
MIT License
231 stars 41 forks source link

Model hosting and `modelzoo pull/push` commands #15

Closed Avsecz closed 6 years ago

Avsecz commented 6 years ago

End goal: Implement the modelzoo subcommands:

Design

# Most recent model
model = modelzoo.load_model("username/model1")

# Specific version
model = modelzoo.load_model("username/model1:v0.1")

# From local directory
model = modelzoo.load_model("~/mymodels/model1")

# From github
model = modelzoo.load_model("https://github.com/kipoi/model-zoo/tree/master/examples/extended_coda")

Open questions

Avsecz commented 6 years ago

I dismissed the modelzoo push command for now. Contributing should be done through github pull requests

  • modelzoo push <model directory> user/model:v1
    • Uploads the local model to the server
Avsecz commented 6 years ago

Implementing this on branch https://github.com/kipoi/model-zoo/tree/kipoi_models_pull_issue15

Avsecz commented 6 years ago

.kipoi/config.yaml

model_sources:
  kipoi:
    type: git-lfs
    remote_url: git@github.com:kipoi/models.git
    local_path: /home/avsec/.kipoi/models/
  asd:
    type: local
    local_path: /data/mymodels/
  asd2:
    type: git
    remote_url: git@github.com:asd/other_models.git
    local_path: ~/.kipoi/other_models/
Avsecz commented 6 years ago

Changed the api to:

# Kipoi model
model = modelzoo.load_model("model1", source="kipoi")
model = modelzoo.load_model("model1") # source defaults to "kipoi"

# Most recent model/ specific version - not implemented

# From directory
model = modelzoo.load_model("~/mymodels/model1", source="dir")

# From github
# Add source in ~/.kipoi/config.yaml or run
modelzoo.config.add_source("my_github_zoo",
                           modelzoo.remote.GitModelSource(remote_url="git@github.com/username/repo",
                                  local_path="/tmp/models/"))
model = modelzoo.load_model("mymodel", source="my_github_zoo")