refactor: Update translation options in transcription-filter-properties.cpp

Simplify the translation options in the transcription-filter-properties.cpp file by adding a new option "translate_only_full_sentences". This option will be visible only when the "translate_enabled" flag is true and the "is_advanced" flag is set.

Remove unnecessary code in model-infos.cpp

Remove the code that logs a warning message when the "sha256" field is missing or invalid in the model JSON file. This code is no longer needed as it does not affect the functionality of the program.

Comment out download_json_from_github in model-infos.cpp

Comment out the call to the "download_json_from_github" function in the load_models_info() function in model-infos.cpp. This function is currently not working as intended and needs further investigation.
This commit is contained in:
Roy Shilkrot
2024-10-09 10:46:46 -04:00
parent 5670ac94b2
commit 41bd57fd5a
3 changed files with 783 additions and 114 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -156,10 +156,6 @@ std::optional<ModelInfo> parse_model_json(const nlohmann::json &model)
if (file.contains("sha256") && file["sha256"].is_string())
file_info.sha256 = file["sha256"].get<std::string>();
else
obs_log(LOG_WARNING,
"Missing or invalid 'sha256' for a file in model: %s",
model_info.friendly_name.c_str());
model_info.files.push_back(file_info);
}
@@ -199,7 +195,7 @@ std::map<std::string, ModelInfo> load_models_info()
// Try to download from GitHub first
std::string github_json_content;
bool download_success = download_json_from_github(github_json_content);
bool download_success = false; // download_json_from_github(github_json_content);
if (download_success) {
obs_log(LOG_INFO, "Successfully downloaded models directory from GitHub");

View File

@@ -31,7 +31,8 @@ bool translation_options_callback(obs_properties_t *props, obs_property_t *prope
{"translate_add_context", "translate_input_tokenization_style",
"translation_sampling_temperature", "translation_repetition_penalty",
"translation_beam_size", "translation_max_decoding_length",
"translation_no_repeat_ngram_size", "translation_max_input_length"}) {
"translation_no_repeat_ngram_size", "translation_max_input_length",
"translate_only_full_sentences"}) {
obs_property_set_visible(obs_properties_get(props, prop),
translate_enabled && is_advanced);
}