@@ -184,6 +184,13 @@ struct common_params_sampling {
184184    std::string print () const ;
185185};
186186
187+ struct  common_params_model  {
188+     std::string path    = " " //  model local path                                           // NOLINT
189+     std::string url     = " " //  model url to download                                      // NOLINT
190+     std::string hf_repo = " " //  HF repo                                                    // NOLINT
191+     std::string hf_file = " " //  HF file                                                    // NOLINT
192+ };
193+ 
187194struct  common_params_speculative  {
188195    std::vector<ggml_backend_dev_t > devices; //  devices to use for offloading
189196
@@ -197,19 +204,11 @@ struct common_params_speculative {
197204    struct  cpu_params  cpuparams;
198205    struct  cpu_params  cpuparams_batch;
199206
200-     std::string hf_repo = " " //  HF repo                                                     // NOLINT
201-     std::string hf_file = " " //  HF file                                                     // NOLINT
202- 
203-     std::string model = " " //  draft model for speculative decoding                      // NOLINT
204-     std::string model_url = " " //  model url to download                                     // NOLINT
207+     struct  common_params_model  model;
205208};
206209
207210struct  common_params_vocoder  {
208-     std::string hf_repo = " " //  HF repo                                                     // NOLINT
209-     std::string hf_file = " " //  HF file                                                     // NOLINT
210- 
211-     std::string model     = " " //  model path                                                // NOLINT
212-     std::string model_url = " " //  model url to download                                     // NOLINT
211+     struct  common_params_model  model;
213212
214213    std::string speaker_file = " " //  speaker file path                                      // NOLINT
215214
@@ -267,12 +266,10 @@ struct common_params {
267266    struct  common_params_speculative  speculative;
268267    struct  common_params_vocoder      vocoder;
269268
270-     std::string model                = " " //  model path                                                    // NOLINT
269+     struct  common_params_model  model;
270+ 
271271    std::string model_alias          = " " //  model alias                                                   // NOLINT
272-     std::string model_url            = " " //  model url to download                                         // NOLINT
273272    std::string hf_token             = " " //  HF token                                                      // NOLINT
274-     std::string hf_repo              = " " //  HF repo                                                       // NOLINT
275-     std::string hf_file              = " " //  HF file                                                       // NOLINT
276273    std::string prompt               = " " //  NOLINT
277274    std::string system_prompt        = " " //  NOLINT
278275    std::string prompt_file          = " " //  store the external prompt file name                           // NOLINT
@@ -347,7 +344,7 @@ struct common_params {
347344    common_conversation_mode conversation_mode = COMMON_CONVERSATION_MODE_AUTO;
348345
349346    //  multimodal models (see examples/llava)
350-     std::string mmproj =  " " ;         //  path to multimodal projector                                         // NOLINT 
347+     struct   common_params_model  mmproj; 
351348    std::vector<std::string> image; //  path to image file(s)
352349
353350    //  embedding
@@ -546,23 +543,6 @@ struct llama_model_params     common_model_params_to_llama  (      common_params
546543struct  llama_context_params    common_context_params_to_llama (const  common_params & params);
547544struct  ggml_threadpool_params  ggml_threadpool_params_from_cpu_params (const  cpu_params & params);
548545
549- struct  llama_model  * common_load_model_from_url (
550-     const  std::string & model_url,
551-     const  std::string & local_path,
552-     const  std::string & hf_token,
553-     const  struct  llama_model_params  & params);
554- 
555- struct  llama_model  * common_load_model_from_hf (
556-     const  std::string & repo,
557-     const  std::string & remote_path,
558-     const  std::string & local_path,
559-     const  std::string & hf_token,
560-     const  struct  llama_model_params  & params);
561- 
562- std::pair<std::string, std::string> common_get_hf_file (
563-     const  std::string & hf_repo_with_tag,
564-     const  std::string & hf_token);
565- 
566546//  clear LoRA adapters from context, then apply new list of adapters
567547void  common_set_adapter_lora (struct  llama_context  * ctx, std::vector<common_adapter_lora_info> & lora);
568548
0 commit comments