File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
src/rai_core/rai/frontend Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change 25
25
from langchain_ollama import ChatOllama , OllamaEmbeddings
26
26
from langchain_openai import ChatOpenAI , OpenAIEmbeddings
27
27
import logging
28
+ import importlib .util
28
29
29
30
30
31
def get_sound_devices (
@@ -946,27 +947,29 @@ def setup_steps():
946
947
step_render = [welcome , model_selection , tracing ]
947
948
948
949
st .session_state .features ["s2s" ] = True
950
+
951
+ if importlib .util .find_spec ("rai_s2s" ) is None :
952
+ logging .warning (
953
+ "Skipping speech recognition, rai_s2s not installed - install `poetry install --with s2s`"
954
+ )
955
+
949
956
try :
950
957
from rai_s2s .asr import TRANSCRIBE_MODELS
951
958
952
959
step_names .append ("🎙️ Speech Recognition" )
953
960
step_render .append (asr )
954
- except ImportError :
961
+ except ImportError as e :
955
962
st .session_state .features ["s2s" ] = False
956
- logging .warning (
957
- "skipping speech recognition, missing import - install `poetry install --with s2s`"
958
- )
963
+ logging .warning (f"Skipping speech recognition. { e } " )
959
964
960
965
try :
961
966
from rai_s2s .tts import TTS_MODELS
962
967
963
968
step_names .append ("🔊 Text to Speech" )
964
969
step_render .append (tts )
965
- except ImportError :
970
+ except ImportError as e :
966
971
st .session_state .features ["s2s" ] = False
967
- logging .warning (
968
- "skipping text to speech, missing import - install `poetry install --with s2s`"
969
- )
972
+ logging .warning (f"Skipping text to speech. { e } " )
970
973
971
974
step_names .extend (
972
975
[
You can’t perform that action at this time.
0 commit comments