Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -20,14 +20,15 @@ DEVICE = 'cuda'
|
|
20 |
loaded_model = whisper.load_model("medium", "cpu")
|
21 |
current_size = "None"
|
22 |
|
23 |
-
def generate_random_filename
|
|
|
24 |
now = datetime.now()
|
25 |
timestamp = now.strftime("%H_%M_%S_%d_%m_%Y")
|
26 |
random_suffix = ''.join(random.choices('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=8))
|
27 |
filename = f"transcript_{timestamp}_{random_suffix}"
|
28 |
return filename
|
29 |
|
30 |
-
@spaces.GPU
|
31 |
def get_transcript(audio_path, task_selection:str, language:str, output_format:str, max_line_width=0
|
32 |
, max_line_count=0, max_words_per_line=0):
|
33 |
writer = get_writer(output_format.lower(), SAVE_DIR)
|
|
|
20 |
loaded_model = whisper.load_model("medium", "cpu")
|
21 |
current_size = "None"
|
22 |
|
23 |
+
def generate_random_filename
|
24 |
+
():
|
25 |
now = datetime.now()
|
26 |
timestamp = now.strftime("%H_%M_%S_%d_%m_%Y")
|
27 |
random_suffix = ''.join(random.choices('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789', k=8))
|
28 |
filename = f"transcript_{timestamp}_{random_suffix}"
|
29 |
return filename
|
30 |
|
31 |
+
@spaces.GPU(enable_queue=True)
|
32 |
def get_transcript(audio_path, task_selection:str, language:str, output_format:str, max_line_width=0
|
33 |
, max_line_count=0, max_words_per_line=0):
|
34 |
writer = get_writer(output_format.lower(), SAVE_DIR)
|