File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -628,9 +628,18 @@ void parseJsonPrompt(std::string json_str, SDParams* params) {
628628 }
629629 try {
630630 std::string sample_method = payload[" sample_method" ];
631- // TODO map to enum value
632- // LOG_WARN("sample_method is not supported yet\n");
633- sd_log (sd_log_level_t ::SD_LOG_WARN, " sample_method is not supported yet\n " );
631+
632+ int sample_method_found = -1 ;
633+ for (int m = 0 ; m < N_SAMPLE_METHODS; m++) {
634+ if (!strcmp (sample_method.c_str (), sample_method_str[m])) {
635+ sample_method_found = m;
636+ }
637+ }
638+ if (sample_method_found >= 0 ) {
639+ params->sample_method = (sample_method_t )sample_method_found;
640+ } else {
641+ sd_log (sd_log_level_t ::SD_LOG_WARN, " Unknown sampling method: %s\n " , sample_method.c_str ());
642+ }
634643 } catch (...) {
635644 }
636645 try {
You can’t perform that action at this time.
0 commit comments