Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -44,13 +44,13 @@ def transcribe_task():
|
|
44 |
file.write(blob.download_blob().readall())
|
45 |
pipe.model.config.forced_decoder_ids = [[2, transcribe_token_id]]
|
46 |
print("Call pipeline...")
|
47 |
-
|
48 |
-
print(text)
|
49 |
with open('new_file.txt', "w") as file:
|
50 |
-
file.write(text)
|
51 |
-
except:
|
52 |
with open('new_file.txt', "w") as file:
|
53 |
-
file.write(
|
54 |
|
55 |
@app.get("/transcribe")
|
56 |
async def transcribe(background_tasks: BackgroundTasks):
|
|
|
44 |
file.write(blob.download_blob().readall())
|
45 |
pipe.model.config.forced_decoder_ids = [[2, transcribe_token_id]]
|
46 |
print("Call pipeline...")
|
47 |
+
res = pipe('audio22.mp3', return_timestamps=True)
|
48 |
+
print(res['text'])
|
49 |
with open('new_file.txt', "w") as file:
|
50 |
+
file.write(res['text'])
|
51 |
+
except Exception as e:
|
52 |
with open('new_file.txt', "w") as file:
|
53 |
+
file.write(str(e))
|
54 |
|
55 |
@app.get("/transcribe")
|
56 |
async def transcribe(background_tasks: BackgroundTasks):
|