Skip to main content

The package is intended for STT, LLM and TSS models chaining.

Project description

cockatoo_chain

This repo is intended for STT, LLM and TSS models chaining.

Development Mode

Development Mode is intended for users who wish to contribute to the repo and thus needs to install additional dev-related packages for, e.g., code quality checking, to satisfy the standard of the repo. If you hope to contribute to the repository, please follow up the follow instructions:

Create virtual environment by poetry

# Force poetry to build virtual environment in the repo.
$ poetry config virtualenvs.in-project true

# Create virtual environment
$ poetry env use python

# Confirm the created virtual environment
$ poetry env info

Enter virtual environment and installed packages

# Get the command to enter virtual environment
$ poetry env activate
$ source activate <your venv>
$ make init-repo-setup

Model A Usage

From cockagoo_chain package, you can easily access the power of Model A (Speech-to-text) with a few lines of codes. We will learn how to from this section. For the time being, cockagoo_chain support below types of model A:

Name Type Supported language Supported file type Note
open_ai_whisper Remote API en, cn and more File uploads are currently limited to 25 MB, and the following input file types are supported: mp3, mp4, mpeg, mpga, m4a, wav, and webm Official doc

Get supported Model A options

You can use below code snippet to get the supported model A options:

>>> from cockatoo_chain.utils import model_a
>>> model_type = model_a.ModelType
>>> list(model_type)
[<ModelType.OPEN_AI_WHISPER: 'open_ai_whisper'>]

Transform input audio file into text

Below code snippet demonstrates how to obtain the OpenAI whipser wrapper for model A and apply it to transform the audio file into text:

>>> test_cn_audio_file_path = '~/test_audio_files/en_20240108_johnlee.wav'
>>> model_a_wrapper = model_a.get(model_type.OPEN_AI_WHISPER)
>>> response = model_a_wrapper.audio_2_text(test_cn_audio_file_path)
>>> response
Audio2TextData(
    text='Hello, this is for testing in English. We will use this to evaluate model SST...',
    spent_time_sec=7.87896990776062,
    audio_file_path='/root/test_audio_files/en_20240108_johnlee.wav')
>>> response.text
'Hello, this is for testing in English. We will use this to evaluate model SST and see how it performs. Thanks.'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cockatoo_chain-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cockatoo_chain-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file cockatoo_chain-0.1.0.tar.gz.

File metadata

  • Download URL: cockatoo_chain-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.11.0-24-generic

File hashes

Hashes for cockatoo_chain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f8d2623a31098c013f8f154d36e161df468cd15fe929b2794b4c1916cf65fd69
MD5 ba1a2b0c3f27371f425362f273853055
BLAKE2b-256 d3db31fd237df5d29760271e26454ab0323f9f306c687c86725b5726f31c4c74

See more details on using hashes here.

File details

Details for the file cockatoo_chain-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cockatoo_chain-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.11.0-24-generic

File hashes

Hashes for cockatoo_chain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 955a31cefae2b57bca0df53751140637184450954ea59aef2f149bc4797e5954
MD5 441fd195a396c055099b4f007bcca1d3
BLAKE2b-256 1d7ae3b33e1ea0e2ae40dcc47d94447fbbb0dca1c468006be46e3518fbe3b7f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page