frogcho123 commited on
Commit
97ed968
·
1 Parent(s): b480da2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -8,7 +8,7 @@ from tempfile import NamedTemporaryFile
8
  # Define translation function
9
  def translate_audio(input_file, target_language):
10
  # Save uploaded audio file to a temporary file
11
- with NamedTemporaryFile(suffix=".mp3", dir=".", delete=False) as temp_audio:
12
  temp_audio.write(input_file.read())
13
  temp_audio.seek(0)
14
  temp_audio_path = temp_audio.name
@@ -53,3 +53,4 @@ title = "Audio Translation"
53
  description = "Upload an audio file, translate the speech to a target language, and download the translated audio."
54
 
55
  gr.Interface(fn=translate_audio, inputs=inputs, outputs=outputs, title=title, description=description).launch()
 
 
8
  # Define translation function
9
  def translate_audio(input_file, target_language):
10
  # Save uploaded audio file to a temporary file
11
+ with NamedTemporaryFile(suffix=".mp3", delete=False) as temp_audio:
12
  temp_audio.write(input_file.read())
13
  temp_audio.seek(0)
14
  temp_audio_path = temp_audio.name
 
53
  description = "Upload an audio file, translate the speech to a target language, and download the translated audio."
54
 
55
  gr.Interface(fn=translate_audio, inputs=inputs, outputs=outputs, title=title, description=description).launch()
56
+