Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting timestamp information with text in Whisper Streaming #296

Open
usman61 opened this issue May 16, 2024 · 0 comments
Open

Not getting timestamp information with text in Whisper Streaming #296

usman61 opened this issue May 16, 2024 · 0 comments

Comments

@usman61
Copy link

usman61 commented May 16, 2024

Initially I was using whisper truss to translate my videos which gives you timestamp information with the translated text in json format.
but now shifted to whisper streaming model to get the translation text in stream but the whisper streaming just dump the translated text without the timestamp information.
is there any way to get the timestamp with the translated text while using whisper streaming?
I am using the given code snippet example which was provided in whisper stream demo.

import requests
import base64

def wav_to_base64(file_path):
with open(file_path, "rb") as wav_file:
binary_data = wav_file.read()
base64_data = base64.b64encode(binary_data)
base64_string = base64_data.decode("utf-8")
return base64_string

resp = requests.post(
"https://model-.api.baseten.co/development/predict",
headers = {"Authorization": "Api-Key BASETEN-API-KEY"},
json={"audio": wav_to_base64("/path/to/wav/input_audio_file.wav")},
stream=True
)

for content in resp.iter_content():
print(content.decode("utf-8"), end="", flush=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant