Skip to content

Using speech-to-text and LLMs to code without hands

License

Notifications You must be signed in to change notification settings

nilq/speech-to-code

Repository files navigation

Speech to Code

Let’s use freely available HuggingFace models to make programming more accessible.

Get started

Environment

This project is set up to use Conda for managing the Python dependency, and uses Poetry for managing Python package dependencies.

Set up the environment using Conda.

$ conda env create -f conda.yaml
$ conda activate speech-to-code

This will give you a fresh Python 3.11 environment.

Install Poetry.

If you have not done this, I reccomend looking at the official guide.

Install speech_to_code

This can be done by using e.g. Poetry for installing the package at the root, using poetry install.

Usage

The most basic usage looks like the following.

from speech_to_code import SpeechToCode

converter = SpeechToCode.default()
converter.convert(file_path="path/to/audio.wav")

This will create a speech-to-code pipeline composed of Distil-Whisper (distil-small.en) and Phi-2.

API

For details on how to run the API, please refer to the api/README.md.

About

Using speech-to-text and LLMs to code without hands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published