Skip to content

Commit

Permalink
merging with ezra-new, updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
benleem committed Oct 7, 2024
1 parent ae7bede commit f83ee35
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 20 deletions.
5 changes: 2 additions & 3 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
{{- if .Arm }}{{ .Arm }}{{ end }}
# use zip for windows archives
format_overrides:
- goos: windows
Expand Down
76 changes: 60 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,91 @@

CLI tool for transcription

## Features

## Build Locally
- Transcribe audio and output to stdout/json (supports multiple file input)
- Helps with drafting captions for your editing workflow

1. Clone repository
2. Either run `go build` and then manually move the resulting binary into your `$PATH`, or just run `go install` to move the executable file to $GOPATH/bin
3. You're good to go!
### Prattl manages its own python distribution

## Prattl manages its own python distribution
When you run `prattl prepare` prattl installs a python distribution specific to your OS to your system, This means you don't need to manage Python dependencies or risk corrupting your existing environments.
`prattl clean` will completely remove this distribution.
`prattl clean` will completely remove this distribution.

## Transcribing
Under the hood, prattl is using [distil-whisper](https://huggingface.co/distil-whisper/distil-large-v3), which runs locally on your system. The better your GPU, the faster the transcription, if you do not have a GPU, it will use your CPU. To create a transcription, use the command:
### Transcribing

`prattl transcribe <filepath>`
Under the hood, prattl is using [distil-whisper](https://huggingface.co/distil-whisper/distil-large-v3), which runs locally on your system. The better your GPU, the faster the transcription, if you do not have a GPU, it will use your CPU. To create a transcription, use the command:

```zsh
prattl transcribe <filepath/to/audio.mp3>
```

You can provide multiple file paths, and prattl will transcribe all of them as a single batch. This means the efficiency increases with more files!

Upon completion, the output will be a JSON object. For instance, if you run:

`prattl transcribe test1.mp3 test2.mp3 test3.mp3`
```zsh
prattl transcribe test1.mp3 test2.mp3 test3.mp3
```

the output will be:

```json
{
"test1.mp3": "test1.mp3's transcription",
"test2.mp3": "test2.mp3's transcription",
"test3.mp3": "test3.mp3's transcription",
"test1.mp3": "test1.mp3's transcription",
"test2.mp3": "test2.mp3's transcription",
"test3.mp3": "test3.mp3's transcription"
}
```

### OS/CPU Architecture Support
## OS/CPU Architecture Support

- windows/386
- windows/amd64
- darwin/arm64
- darwin/amd64
- linux-gnu/arm64
- linux-gnu/amd64

> **_NOTE:_** CUDA architecture GPUs can take advantage of GPU acceleration for transcription
> [!NOTE]
> CUDA architecture GPUs can take advantage of GPU acceleration for transcription
<!-- > **_NOTE:_** CUDA architecture GPUs can take advantage of GPU acceleration for transcription -->

## Prerequisites

[go](https://go.dev/) installed and included in `$PATH`

### Prerequisites
[ffmpeg](https://www.ffmpeg.org/) installed and included in `$PATH`

## Build Locally

1. Clone repository
2. cd into the cloned repository
3. Either run `go build` and then manually move the resulting binary into your `$PATH`, or just run `go install` to install the executable file to `$GOPATH/bin`
4. You're good to go!

## Usage

Help with any prattl command

```zsh
prattl help
```

Prepare the python distribution at `$HOME/.prattl` required by prattl

```zsh
prattl prepare
```

Remove the python distribution built at `$HOME/.prattl` by prattl

```zsh
prattl clean
```

Transcribe provided audio by pathname(s), output transcription to stdout/json

```zsh
prattl transcribe <filepath/to/audio.mp3> <filepath/to/second_audio.mp3>
```
2 changes: 1 addition & 1 deletion cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var cleanCommand = &cobra.Command{
Long: "This command removes everything prattl adds to your filesystem",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
env, err := pysrc.GetPrattlEnv()
env, err := pysrc.PrattlEnv()
if err != nil {
return fmt.Errorf("Error getting prattl env: %v\n", err)
}
Expand Down

0 comments on commit f83ee35

Please sign in to comment.