Krishna086 commited on
Commit
e3b5cc2
·
verified ·
1 Parent(s): 7a23dcf

Update audio_processor.py

Browse files
Files changed (1) hide show
  1. audio_processor.py +1 -1
audio_processor.py CHANGED
@@ -37,7 +37,7 @@ def text_to_speech(text, target_lang, max_retries=2):
37
  if audio_buffer.getbuffer().nbytes > 0:
38
  st.success(f"Audio generated for {target_lang} on attempt {attempt + 1}")
39
  return audio_buffer
40
- time.sleep(2 ** attempt) # Exponential backoff
41
  except Exception as e:
42
  st.warning(f"Attempt {attempt + 1} failed: {str(e)}")
43
  if attempt == max_retries - 1:
 
37
  if audio_buffer.getbuffer().nbytes > 0:
38
  st.success(f"Audio generated for {target_lang} on attempt {attempt + 1}")
39
  return audio_buffer
40
+ time.sleep(2 ** attempt) # Exponential backoff for rate limits
41
  except Exception as e:
42
  st.warning(f"Attempt {attempt + 1} failed: {str(e)}")
43
  if attempt == max_retries - 1: