-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/model import cmd #1248
Feat/model import cmd #1248
Conversation
Need to add API for model import, to allow Jan's user import their models |
…feat/model-import-cmd
@nguyenhoangthuan99 Will we be implementing the API as a separate issue? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm - will let @vansangpfiev @namchuai evaluate for code.
- Import API will be separate PR?
I added API in this PR because the logic is the same, and it makes us easier to track. |
Closes #1058 |
Related Issues
Fix #1249
Add Model Import Command to CLI
This PR introduces a new
import
subcommand to themodels
command in our CLI application. The new functionality allows users to import GGUF (GPT-Generated Unified Format) models from local files into the application.Features
Implementation Details
The implementation consists of two main parts:
ModelImportCmd
class inmodel_import_cmd.h
andmodel_import_cmd.cpp
ModelImportCmd
This class handles the core logic of importing a model:
GGUFHandler
ModelConfig
object with the parsed informationYamlHandler
ModelListUtils
Error handling is implemented to ensure robust operation, including cleaning up partially created files in case of failures.
CLI Setup
The
import
subcommand is added to themodels
command with the following options:--model_id
: A required option to specify the unique identifier for the imported model--model_path
: A required option to specify the absolute path to the GGUF model fileUsage
To import a model, users can now use the following command: