Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions singlestoredb/fusion/handlers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
from .utils import get_inference_api


class ShowModelsHandler(ShowFilesHandler):
class ShowCustomModelsHandler(ShowFilesHandler):
"""
SHOW MODELS
SHOW CUSTOM MODELS
[ at_path ] [ <like> ]
[ <order-by> ]
[ <limit> ] [ recursive ] [ extended ];
Expand Down Expand Up @@ -55,16 +55,16 @@ class ShowModelsHandler(ShowFilesHandler):
--------
The following command lists the models::

SHOW MODELS;
SHOW CUSTOM MODELS;

The following command lists the models with additional information::

SHOW MODELS EXTENDED;
SHOW CUSTOM MODELS EXTENDED;

See Also
--------
* ``UPLOAD MODEL model_name FROM path``
* ``DOWNLOAD MODEL model_name``
* ``UPLOAD CUSTOM MODEL model_name FROM path``
* ``DOWNLOAD CUSTOM MODEL model_name``


""" # noqa: E501
Expand All @@ -75,12 +75,12 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
return super().run(params)


ShowModelsHandler.register(overwrite=True)
ShowCustomModelsHandler.register(overwrite=True)


class UploadModelHandler(SQLHandler):
class UploadCustomModelHandler(SQLHandler):
"""
UPLOAD MODEL model_name
UPLOAD CUSTOM MODEL model_name
FROM local_path [ overwrite ];

# Model Name
Expand Down Expand Up @@ -112,12 +112,12 @@ class UploadModelHandler(SQLHandler):
The following command uploads a file to models space and overwrite any
existing files at the specified path::

UPLOAD MODEL model_name
UPLOAD CUSTOM MODEL model_name
FROM 'llama3/' OVERWRITE;

See Also
--------
* ``DOWNLOAD MODEL model_name``
* ``DOWNLOAD CUSTOM MODEL model_name``

""" # noqa: E501

Expand Down Expand Up @@ -145,12 +145,12 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
return None


UploadModelHandler.register(overwrite=True)
UploadCustomModelHandler.register(overwrite=True)


class DownloadModelHandler(SQLHandler):
class DownloadCustomModelHandler(SQLHandler):
"""
DOWNLOAD MODEL model_name
DOWNLOAD CUSTOM MODEL model_name
[ local_path ]
[ overwrite ];

Expand Down Expand Up @@ -184,17 +184,17 @@ class DownloadModelHandler(SQLHandler):
The following command displays the contents of the file on the
standard output::

DOWNLOAD MODEL llama3;
DOWNLOAD CUSTOM MODEL llama3;

The following command downloads a model to a specific location and
overwrites any existing models folder with the name ``local_llama3`` on the local storage::

DOWNLOAD MODEL llama3
DOWNLOAD CUSTOM MODEL llama3
TO 'local_llama3' OVERWRITE;

See Also
--------
* ``UPLOAD MODEL model_name FROM local_path``
* ``UPLOAD CUSTOM MODEL model_name FROM local_path``

""" # noqa: E501

Expand All @@ -213,12 +213,12 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
return None


DownloadModelHandler.register(overwrite=True)
DownloadCustomModelHandler.register(overwrite=True)


class DropModelsHandler(SQLHandler):
class DropCustomModelHandler(SQLHandler):
"""
DROP MODEL model_name;
DROP CUSTOM MODEL model_name;

# Model Name
model_name = '<model-name>'
Expand All @@ -235,7 +235,7 @@ class DropModelsHandler(SQLHandler):
--------
The following commands deletes a model from a model space::

DROP MODEL llama3;
DROP CUSTOM MODEL llama3;

""" # noqa: E501

Expand All @@ -249,7 +249,7 @@ def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
return None


DropModelsHandler.register(overwrite=True)
DropCustomModelHandler.register(overwrite=True)


class StartModelHandler(SQLHandler):
Expand Down