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

Sweep: Use STT model name when calling OpenAI API #9

Closed
wants to merge 1 commit into from

Conversation

sweep-ai[bot]
Copy link

@sweep-ai sweep-ai bot commented Jun 8, 2024

Purpose

This pull request addresses an issue where the STT model name is not used when calling the OpenAI API, resulting in the default model whisper-1 being used instead of the configured model.

Description

The changes in this pull request include:

  1. In the backend/apps/audio/main.py file, the transcribe function now accepts a model parameter, which is used to set the model_size_or_path in the whisper_kwargs dictionary.

  2. In the src/lib/apis/openai/index.ts file, a new transcribe function has been added that takes a model parameter and appends it to the form data when making the API request to OpenAI.

  3. In the src/lib/components/chat/Settings/Audio.svelte file, a new input field has been added to allow the user to specify the STT model name when the whisper-openai STT engine is selected.

Summary

  • Updated backend/apps/audio/main.py to use the provided model parameter when calling the OpenAI API
  • Added a new transcribe function in src/lib/apis/openai/index.ts that accepts a model parameter
  • Added a new input field in src/lib/components/chat/Settings/Audio.svelte to allow the user to specify the STT model name when using the whisper-openai engine

Fixes #8.


Tip

To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

This is an automated message generated by Sweep AI.

Copy link
Author

sweep-ai bot commented Jun 8, 2024

Rollback Files For Sweep

  • Rollback changes to src/lib/apis/openai/index.ts
  • Rollback changes to backend/apps/audio/main.py
  • Rollback changes to src/lib/components/chat/Settings/Audio.svelte

This is an automated message generated by Sweep AI.

Copy link
Author

sweep-ai bot commented Jun 8, 2024

Sweep: PR Review

Author: sweep-ai[bot]

Sweep Found These Issues

  • In src/lib/apis/openai/index.ts: The transcribe function does not handle the case where the file parameter is null or undefined, which could lead to runtime errors.
  • export const transcribe = async (
    token: string = '',
    file: File,
    model: string = 'whisper-1'

    View Diff

  • In src/lib/apis/openai/index.ts: The transcribe function does not validate the model parameter, which could result in invalid model names being sent to the API.
  • file: File,
    model: string = 'whisper-1'

    View Diff


@bannert1337 bannert1337 deleted the sweep/stt_model_name_is_not_used_when_calling branch June 27, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sweep: STT model name is not used when calling the OpenAI API
1 participant