-
Notifications
You must be signed in to change notification settings - Fork 14.9k
llama-tts : add -o option #12042
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
llama-tts : add -o option #12042
Conversation
common/arg.cpp
Outdated
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.
I think it's now time to convert this block into if..else
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.
sure!
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.
@ngxson Hi, could you pls have a look a the changes see if they are ok ? MAny thanks..
common/common.h
Outdated
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.
| std::string | |
| lora_outfile = "ggml-lora-merged-f16.gguf", | |
| ttss_outfile = "output.wav"; | |
| std::string lora_outfile = "ggml-lora-merged-f16.gguf"; | |
| std::string ttss_outfile = "output.wav"; |
examples/tts/tts.cpp
Outdated
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.
| int retval(0); | |
| int retval = 0; |
examples/tts/tts.cpp
Outdated
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.
| } | |
| else { | |
| retval=ENOENT; | |
| } else { | |
| retval = ENOENT; |
common/arg.cpp
Outdated
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.
| std::string * out_file_ptr; | |
| const char * default_out_file; |
And also change the rest to match
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.
@ngxson thank you, all changes done and committed on this PR.
common/arg.cpp
Outdated
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.
| if (ex == LLAMA_EXAMPLE_EXPORT_LORA) | |
| default_out_file = params.lora_outfile.c_str(); | |
| else if (ex == LLAMA_EXAMPLE_CVECTOR_GENERATOR) | |
| default_out_file = params.cvector_outfile.c_str(); | |
| else if (ex == LLAMA_EXAMPLE_TTS) | |
| default_out_file = params.ttss_outfile.c_str(); | |
| else // currently coded as "imatrix.dat", see common.h | |
| default_out_file = params.out_file.c_str(); | |
| if (ex == LLAMA_EXAMPLE_EXPORT_LORA) { | |
| default_out_file = params.lora_outfile.c_str(); | |
| } else if (ex == LLAMA_EXAMPLE_CVECTOR_GENERATOR) { | |
| default_out_file = params.cvector_outfile.c_str(); | |
| } else if (ex == LLAMA_EXAMPLE_TTS) { | |
| default_out_file = params.ttss_outfile.c_str(); | |
| } else // currently coded as "imatrix.dat", see common.h | |
| default_out_file = params.out_file.c_str(); | |
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.
thank you, committed.
common/common.h
Outdated
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.
It might be simpler to just have a single std::string outfile; parameter that is used by all examples to output things.
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.
yes, I see that this requires some changes also in cvector-generator and export-lora. If ok for you I refactor this, perhaps with a dedicated PR ?
examples/tts/tts.cpp
Outdated
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.
| retval=ENOENT; | |
| retval = ENOENT; |
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.
thank you, committed.
As discussed in PR 'llama-tts : add -o option' (ggml-org#12042): * common_params : 'out_file' string is the only output file name parameter left in common_params. It's intended to be used in all example programs implementing an '-o' option. * cvector-generator, export-lora, imatrix : default output filenames moved from 'common_params' to the 'main()' of each example program.
As discussed in PR 'llama-tts : add -o option' (#12042): * common_params : 'out_file' string is the only output file name parameter left in common_params. It's intended to be used in all example programs implementing an '-o' option. * cvector-generator, export-lora, imatrix : default output filenames moved from 'common_params' to the 'main()' of each example program.
|
@ggerganov Good morning, thank you for approving/merging the PR 'Refactoring -o option' (#12278). After the merge, many of the commits of this PR are obsolete. Is it ok for you if I open a new PR for implementing the '-o' on llama-tts? |
|
Yes you can either open a new PR or fix commit using |
* added -o option to specify an output file name * llama-tts returns ENOENT in case of file write error note : PR ggml-org#12042 is closed as superseded with this one.
* added -o option to specify an output file name * llama-tts returns ENOENT in case of file write error note : PR #12042 is closed as superseded with this one.
As discussed in PR 'llama-tts : add -o option' (ggml-org#12042): * common_params : 'out_file' string is the only output file name parameter left in common_params. It's intended to be used in all example programs implementing an '-o' option. * cvector-generator, export-lora, imatrix : default output filenames moved from 'common_params' to the 'main()' of each example program.
* added -o option to specify an output file name * llama-tts returns ENOENT in case of file write error note : PR ggml-org#12042 is closed as superseded with this one.
enabled optional cmdline argument '-o' on tts to specify an output filename. It defaults to 'output.wav'.
program now returns ENOENT in case of file write failure