aadnk commited on
Commit
ce65f49
1 Parent(s): af09fe7

Hande NULLs in from_string

Browse files
Files changed (1) hide show
  1. src/config.py +3 -1
src/config.py CHANGED
@@ -41,8 +41,10 @@ class VadInitialPromptMode(Enum):
41
  return VadInitialPromptMode.PREPREND_FIRST_SEGMENT
42
  elif normalized == "json_prompt_mode":
43
  return VadInitialPromptMode.JSON_PROMPT_MODE
44
- else:
45
  raise ValueError(f"Invalid value for VadInitialPromptMode: {s}")
 
 
46
 
47
  class ApplicationConfig:
48
  def __init__(self, models: List[ModelConfig] = [], input_audio_max_duration: int = 600,
 
41
  return VadInitialPromptMode.PREPREND_FIRST_SEGMENT
42
  elif normalized == "json_prompt_mode":
43
  return VadInitialPromptMode.JSON_PROMPT_MODE
44
+ elif normalized is not None and normalized != "":
45
  raise ValueError(f"Invalid value for VadInitialPromptMode: {s}")
46
+ else:
47
+ return None
48
 
49
  class ApplicationConfig:
50
  def __init__(self, models: List[ModelConfig] = [], input_audio_max_duration: int = 600,