@@ -1851,16 +1851,27 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
1851
1851
params.i_pos = value;
1852
1852
}
1853
1853
).set_examples ({LLAMA_EXAMPLE_PASSKEY}));
1854
+
1855
+ // retrieving the right default output filename,
1856
+ // depending on the example program...
1857
+ std::string * out_file_ptr;
1858
+
1859
+ if (ex == LLAMA_EXAMPLE_EXPORT_LORA)
1860
+ out_file_ptr = & params.lora_outfile ;
1861
+
1862
+ else if (ex == LLAMA_EXAMPLE_CVECTOR_GENERATOR)
1863
+ out_file_ptr = & params.cvector_outfile ;
1864
+
1865
+ else if (ex == LLAMA_EXAMPLE_TTS)
1866
+ out_file_ptr = & params.ttss_outfile ;
1867
+
1868
+ else // currently coded as "imatrix.dat", see common.h
1869
+ out_file_ptr = & params.out_file ;
1870
+
1854
1871
add_opt (common_arg (
1855
1872
{" -o" , " --output" , " --output-file" }, " FNAME" ,
1856
1873
string_format (" output file (default: '%s')" ,
1857
- ex == LLAMA_EXAMPLE_EXPORT_LORA
1858
- ? params.lora_outfile .c_str ()
1859
- : ex == LLAMA_EXAMPLE_CVECTOR_GENERATOR
1860
- ? params.cvector_outfile .c_str ()
1861
- : ex == LLAMA_EXAMPLE_TTS
1862
- ? params.ttss_outfile .c_str ()
1863
- : params.out_file .c_str ()),
1874
+ out_file_ptr->c_str ()),
1864
1875
[](common_params & params, const std::string & value) {
1865
1876
params.out_file = value;
1866
1877
params.cvector_outfile = value;
0 commit comments