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

whisper-1 and llm whisper-api (fixes) #729

Open
leifulstrup opened this issue Jan 31, 2025 · 0 comments
Open

whisper-1 and llm whisper-api (fixes) #729

leifulstrup opened this issue Jan 31, 2025 · 0 comments

Comments

@leifulstrup
Copy link

(A) llm-whisper-api does not work without adding whisper-1 as an extra model (it's missing from your standard list)

I tried this: https://simonwillison.net/2024/Oct/27/llm-whisper-api/

I listed llm models and whisper-1 does not show as an option. Your python code depends for extension assumes whisper-1 is included in the standard list.

(B) I then tried to add whisper-1 using your "adding more openai models" instructions and ran into another problem...

I then found used your instructions here: https://llm.datasette.io/en/stable/openai-models.html#adding-more-openai-models

I get this error:

File "/usr/local/Cellar/llm/0.20/libexec/lib/python3.13/site-packages/llm/default_plugins/openai_models.py", line 101, in register_models
model_name = extra_model["model_name"]
~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'model_name'

I reviewed the python code in openai_model.py code and see that it uses:

Load extra models

extra_path = llm.user_dir() / "extra-openai-models.yaml"
if not extra_path.exists():
    return
with open(extra_path) as f:
    extra_models = yaml.safe_load(f)
for extra_model in extra_models:
    model_id = extra_model["model_id"]
    aliases = extra_model.get("aliases", [])
    model_name = extra_model["model_name"]
    api_base = extra_model.get("api_base")
    api_type = extra_model.get("api_type")
    api_version = extra_model.get("api_version")
    api_engine = extra_model.get("api_engine")
    headers = extra_model.get("headers")
    kwargs = {}

It looks like model_name = extra_model["model_name"] should be model_name = extra_model.get("model_name", [])

and/OR the instructions for extra-openai-models.yaml should say:

  • model_id: whisper-1
    aliases: ["whisper-1"]
    model_name: "whisper-1"

(C) You should include whisper-1 in the default list of openai models or explain here that it needs to be added with how to do it - https://simonwillison.net/2024/Oct/27/llm-whisper-api/

(D) I've fixed the yaml to add the line for model_name: "whisper-1" and it loads the extra model and llm whisper-api myfile.mp3 > transcript.txt works as advertised

(E) it would be great if that extension chunked a lonk mp3 or wave up into 25m or less chunks since whisper-1 balks if it is a long audio file

*** Thank you for all of your YT videos, blog, and bsky posts! You are amazingly talented.

The LLM cli tool is terrific and I'm using it frequently.

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