rick commited on
Commit
25c0823
·
unverified ·
1 Parent(s): cbefa53
Files changed (1) hide show
  1. core/speech_to_text.py +2 -1
core/speech_to_text.py CHANGED
@@ -126,6 +126,7 @@ def translate_audio(filepath: Union[str, IO]) -> str:
126
  Returns:
127
  str: Le texte traduit.
128
  """
 
129
  translated_text = []
130
  client = OpenAI(api_key=getenv("OPENAI_API_KEY"))
131
  try:
@@ -149,7 +150,7 @@ def translate_audio(filepath: Union[str, IO]) -> str:
149
 
150
  translation = client.audio.translations.create(
151
  model="whisper-1",
152
- file=audio_file
153
  )
154
  translated_text.append(translation)
155
 
 
126
  Returns:
127
  str: Le texte traduit.
128
  """
129
+ max_size_mb = 25
130
  translated_text = []
131
  client = OpenAI(api_key=getenv("OPENAI_API_KEY"))
132
  try:
 
150
 
151
  translation = client.audio.translations.create(
152
  model="whisper-1",
153
+ file=("audio.mp3", buffer)
154
  )
155
  translated_text.append(translation)
156