mr2along commited on
Commit
b63b447
1 Parent(s): 08defc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -50,9 +50,10 @@ def create_pronunciation_audio(word):
50
  time.sleep(5) # Chờ 5 giây
51
  tts = gTTS(word)
52
  audio_file_path = f"audio/{word}.mp3" # Save the audio to a file
 
53
  tts.save(audio_file_path)
54
  print(f"audio/{word}: {audio_file_path}")
55
- return f"https://mr2along-speech-recognize.hf.space/gradio_api/file=/tmp/gradio/fdecb56cb7306418314e505dff8775673ca46761fc0edf3a891ab99293292055/{audio_file_path}" # Return the file path of the saved audio
56
 
57
  # Step 3: Compare the transcribed text with the input paragraph
58
  def compare_texts(reference_text, transcribed_text):
 
50
  time.sleep(5) # Chờ 5 giây
51
  tts = gTTS(word)
52
  audio_file_path = f"audio/{word}.mp3" # Save the audio to a file
53
+ path=os.getenv('code')
54
  tts.save(audio_file_path)
55
  print(f"audio/{word}: {audio_file_path}")
56
+ return f"https://mr2along-speech-recognize.hf.space/gradio_api/file=/tmp/gradio/{path}/{audio_file_path}" # Return the file path of the saved audio
57
 
58
  # Step 3: Compare the transcribed text with the input paragraph
59
  def compare_texts(reference_text, transcribed_text):