You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// generateCmd represents the modelfile tools command for generating modelfile.
34
35
vargenerateCmd=&cobra.Command{
35
-
Use: "generate [flags] <path>",
36
-
Short: "A command line tool for generating modelfile in the workspace, the workspace must be a directory including model files and model configuration files",
37
-
Args: cobra.ExactArgs(1),
36
+
Use: "generate [flags] [<path>]",
37
+
Short: "Generate a modelfile from a local workspace or remote model provider",
38
+
Long: `Generate a modelfile from either a local directory containing model files or by downloading a model from a supported provider.
39
+
40
+
The workspace must be a directory including model files and model configuration files.
41
+
Alternatively, use --model-url to download a model from a supported provider (e.g., HuggingFace, ModelScope).
42
+
43
+
For short-form URLs (owner/repo), you must explicitly specify the provider using --provider flag.
44
+
Full URLs with domain names will auto-detect the provider.`,
45
+
Example: ` # Generate from local directory
46
+
modctl modelfile generate ./my-model-dir
47
+
48
+
# Generate from Hugging Face using full URL (auto-detects provider)
flags.StringVarP(&generateConfig.Output, "output", "O", ".", "specify the output path of modelfilem, must be a directory")
65
110
flags.BoolVar(&generateConfig.IgnoreUnrecognizedFileTypes, "ignore-unrecognized-file-types", false, "ignore the unrecognized file types in the workspace")
66
111
flags.BoolVar(&generateConfig.Overwrite, "overwrite", false, "overwrite the existing modelfile")
112
+
flags.StringVar(&generateConfig.ModelURL, "model-url", "", "download model from a supported provider (full URL or short-form with --provider)")
113
+
flags.StringVarP(&generateConfig.Provider, "provider", "p", "", "explicitly specify the provider for short-form URLs (huggingface, modelscope)")
114
+
flags.StringVar(&generateConfig.DownloadDir, "download-dir", "", "custom directory for downloading models (default: system temp directory)")
0 commit comments