Skip to content
Discussion options

You must be logged in to vote

Thank you @threeal for your response :
I got this error :

can only concatenate str (not "dict") to str
when calling the transcribe() method

This is the code that i wrote :

audio_file = request.files['media'] // This is how i got the file when calling my endpoint (i'm using flask)
buf = io.BytesIO(audio_file.read())
data, sr = librosa.load(buf)

if sr != 16000:
   print('data is different than 16000')
   data = librosa.resample(data, orig_sr=sr, target_sr=16000)
   
model = whisper.load_model("tiny")
model.transcribe(data,fp16=False)

I think that the problem is in this line of code :

buf = io.BytesIO(audio_file.read())

Many thanks in advance.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ilyasbendev
Comment options

Answer selected by ilyasbendev
@threeal
Comment options

@ilyasbendev
Comment options

@ilyasbendev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants