OpenSound commited on
Commit
d68e603
·
1 Parent(s): 292c2fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -191,25 +191,25 @@ def transcribe(seed, audio_path):
191
 
192
  @spaces.GPU
193
  def align_segments(transcript, audio_path):
194
- from aeneas.executetask import ExecuteTask
195
- from aeneas.task import Task
196
- import json
197
- config_string = 'task_language=eng|os_task_file_format=json|is_text_type=plain'
198
-
199
- tmp_transcript_path = os.path.join(TMP_PATH, f"{get_random_string()}.txt")
200
- tmp_sync_map_path = os.path.join(TMP_PATH, f"{get_random_string()}.json")
201
- with open(tmp_transcript_path, "w") as f:
202
- f.write(transcript)
203
-
204
- task = Task(config_string=config_string)
205
- task.audio_file_path_absolute = os.path.abspath(audio_path)
206
- task.text_file_path_absolute = os.path.abspath(tmp_transcript_path)
207
- task.sync_map_file_path_absolute = os.path.abspath(tmp_sync_map_path)
208
- ExecuteTask(task).execute()
209
- task.output_sync_map_file()
210
-
211
- with open(tmp_sync_map_path, "r") as f:
212
- return json.load(f)
213
 
214
  @spaces.GPU
215
  def align(seed, transcript, audio_path):
 
191
 
192
  @spaces.GPU
193
  def align_segments(transcript, audio_path):
194
+ # from aeneas.executetask import ExecuteTask
195
+ # from aeneas.task import Task
196
+ # import json
197
+ # config_string = 'task_language=eng|os_task_file_format=json|is_text_type=plain'
198
+
199
+ # tmp_transcript_path = os.path.join(TMP_PATH, f"{get_random_string()}.txt")
200
+ # tmp_sync_map_path = os.path.join(TMP_PATH, f"{get_random_string()}.json")
201
+ # with open(tmp_transcript_path, "w") as f:
202
+ # f.write(transcript)
203
+
204
+ # task = Task(config_string=config_string)
205
+ # task.audio_file_path_absolute = os.path.abspath(audio_path)
206
+ # task.text_file_path_absolute = os.path.abspath(tmp_transcript_path)
207
+ # task.sync_map_file_path_absolute = os.path.abspath(tmp_sync_map_path)
208
+ # ExecuteTask(task).execute()
209
+ # task.output_sync_map_file()
210
+
211
+ # with open(tmp_sync_map_path, "r") as f:
212
+ # return json.load(f)
213
 
214
  @spaces.GPU
215
  def align(seed, transcript, audio_path):