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

Add new job_details.model key to transcribe return dict #1225

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ururk
Copy link

@ururk ururk commented Apr 12, 2023

Per discussion #1112

I've added a new key to the return dictionary from the transcribe def:

{
    "job_details": {
        "model": "base"
    },
    "text": " And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.",
    "segments": [{"id": 0, "seek": 0, "start": 0.0, "end": 11.0, "text": " And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.", "tokens": [50364, 400, 370, 452, 7177, 6280, 11, 1029, 406, 437, 428, 1941, 393, 360, 337, 291, 11, 1029, 437, 291, 393, 360, 337, 428, 1941, 13, 50914], "temperature": 0.0, "avg_logprob": -0.2968965598515102, "compression_ratio": 1.3544303797468353, "no_speech_prob": 0.04440217837691307}], "language": "en"
}

Besides model, there may be other parameters passed to whisper that could be useful, hence the nested key instead of a top-level property.

@ururk
Copy link
Author

ururk commented Apr 25, 2023

Would you prefer the model be part of the main result dict instead of a in a sub dictionary?

@ururk
Copy link
Author

ururk commented May 4, 2023

One additional comment. The model_name param could also be passed to whisper as a full path - in that event the string stored would be the full path to the model used, and not the name of the model (ie, medium.en). I'm not sure how this should be handled. This also calls into question whether it needs to generate three keys, which I'm doing in my own code (not this pull request):

model_name (if a path is given to whisper, computed from the path)
model_path (path to model, including file with extension)
model_checksum (SHA256 checksum of the model file, used to further compare runs across time)

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