Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -102,14 +102,13 @@ try:
|
|
102 |
str_left_to_right += convert_to_braille_unicode(model.names[int(each_class)])
|
103 |
result += str_left_to_right + "\n"
|
104 |
st.write(str_left_to_right)
|
105 |
-
|
106 |
except Exception as ex:
|
107 |
-
st.write("
|
108 |
|
109 |
def text_to_speech_gtts(text, lang='en', filename="output.mp3"):
|
110 |
"""将文本转换为语音并保存音频文件"""
|
111 |
tts = gTTS(text=text, lang=lang)
|
112 |
-
audio_path = "./output_audio"
|
113 |
tts.save(audio_path)
|
114 |
return audio_path
|
115 |
|
|
|
102 |
str_left_to_right += convert_to_braille_unicode(model.names[int(each_class)])
|
103 |
result += str_left_to_right + "\n"
|
104 |
st.write(str_left_to_right)
|
|
|
105 |
except Exception as ex:
|
106 |
+
st.write("Please try again with images with types of JPG, JPEG, PNG ...")
|
107 |
|
108 |
def text_to_speech_gtts(text, lang='en', filename="output.mp3"):
|
109 |
"""将文本转换为语音并保存音频文件"""
|
110 |
tts = gTTS(text=text, lang=lang)
|
111 |
+
audio_path = "./output_audio/output.mp3"
|
112 |
tts.save(audio_path)
|
113 |
return audio_path
|
114 |
|