oracle / accelerated-data-science

ADS is the Oracle Data Science Cloud Service's python SDK supporting, model ops (train/eval/deploy), along with running workloads on Jobs and Pipeline resources.
https://accelerated-data-science.readthedocs.io/
Universal Permissive License v1.0
87 stars 43 forks source link

Model creation from Object Storage #871

Closed VipulMascarenhas closed 4 months ago

VipulMascarenhas commented 4 months ago

Description

This PR includes changes for the following:

  1. Removing references of HF apis.
  2. Add a new register post API to register the imported models, returns AquaModel instead of DataScienceModel object.
  3. Update register API to accept model name and os_path, remove redundant parameters.
  4. Use default signer instead of using auth from AquaApp.

Using the API

Request

POST http://localhost:8888/aqua/model
{
    "model": "google/gemma-2b",
    "os_path": "oci://bucket-name@namespace/aqua/models/google/gemma-2b",
    "inference_container": "odsc-tgi-serving"
}

Response

{
    "compartment_id": "ocid1.compartment.oc1..<ocid>",
    "icon": "",
    "id": "ocid1.datasciencemodel.oc1.iad.<ocid>",
    "is_fine_tuned_model": false,
    "license": "gemma",
    "name": "google/gemma-2b",
    "organization": "Google",
    "project_id": "ocid1.datascienceproject.oc1.iad.<ocid>",
    "tags": {
        "aqua_service_model": "ocid1.datasciencemodel.oc1.iad.<ocid>",
        "license": "gemma",
        "task": "text_generation",
        "organization": "Google",
        "aqua_custom_base_model": "true",
        "OCI_AQUA": "active",
        "ready_to_fine_tune": "true"
    },
    "task": "text_generation",
    "time_created": "2024-05-29 18:10:05.283000+00:00",
    "console_link": [
        "https://cloud.oracle.com/data-science/models/ocid1.datasciencemodel.oc1.iad.<ocid>?region=us-ashburn-1"
    ],
    "search_text": "ocid1.datasciencemodel.oc1.iad.<ocid>,gemma,text_generation,Google,true,active,true",
    "ready_to_deploy": true,
    "ready_to_finetune": true,
    "ready_to_import": false,
    "model_card": "",
    "inference_container": "odsc-tgi-serving",
    "finetuning_container": "odsc-llm-fine-tuning",
    "evaluation_container": "odsc-llm-evaluate"
}

Tests

> python -m pytest -q tests/unitary/with_extras/aqua/test_model*.py
==================================== test session starts ====================================
platform darwin -- Python 3.8.18, pytest-7.4.0, pluggy-1.0.0
rootdir: /Users/user/workspace/git/accelerated-data-science
configfile: pytest.ini
plugins: Faker-24.9.0, anyio-4.2.0
collected 24 items

tests/unitary/with_extras/aqua/test_model.py .................                        [ 70%]
tests/unitary/with_extras/aqua/test_model_handler.py .......                          [100%]

==================================== 24 passed in 3.67s =====================================
github-actions[bot] commented 4 months ago

⚠️ This PR changed pyproject.toml file. ⚠️