Spaces:
Running
Running
Update apis/chat_api.py
Browse files- apis/chat_api.py +5 -3
apis/chat_api.py
CHANGED
@@ -348,9 +348,11 @@ async def whisper_transcribe(
|
|
348 |
)
|
349 |
time_start = time.time()
|
350 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=language, task="transcribe")
|
351 |
-
|
352 |
-
|
353 |
-
|
|
|
|
|
354 |
time_end = time.time()
|
355 |
item_response["status"] = 200
|
356 |
item_response["result"] = text
|
|
|
348 |
)
|
349 |
time_start = time.time()
|
350 |
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=language, task="transcribe")
|
351 |
+
file_data = await audio_file.read()
|
352 |
+
# rv = data.encode('utf-8')
|
353 |
+
rv = base64.b64encode(file_data)
|
354 |
+
print(rv, "rvrvrvrvr")
|
355 |
+
text = pipe(rv)["text"]
|
356 |
time_end = time.time()
|
357 |
item_response["status"] = 200
|
358 |
item_response["result"] = text
|