• Stars
    star
    1,802
  • Rank 25,778 (Top 0.6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 2 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Whisper as a Service (GUI and API with queuing for OpenAI Whisper)

WaaS - Whisper as a Service

GUI and API for OpenAI Whisper

jojo.mov

WAAS is released under the Apache-2.0 license

What is Jojo?

Jojo is a GUI for upload and transcribe a audio or video file. After the transcription is done you get an email with download links. You can directly download a Jojo-file, SRT, or text from the email. Then you can upload a Jojo file to the frontend to come into an editor (see video).

Editor

The editor works 100% local in your browser. Here can you listen to segments and fix transcriptions errors. After you are done just save the Jojo-file to your desktop. An easy way to play the selected segment is by holding down the Control-key on the keyboard.

This project started out by VG

API Documentation

POST /v1/transcribe

Add a new transcribe job to the queue. The job will be processed by the worker asynchroniously.

The response will be a JSON object with job_id that can be used to check the status of the job.

Query parameters:

  • REQUIRED: email_callback: string or webhook_id: string
  • OPTIONAL: language: string (default: automatic detection)
  • OPTIONAL: model: string (default: tiny)
  • OPTIONAL: task: string (default: transcribe)
    • transcribe: Transcribe audio to text
    • translate: Transcribe then translate audio to text
  • OPTIONAL: filename: string (default: untitled-transcription)

Body:

  • REQUIRED: binary data: Raw data with the audio content to transcribe

OPTIONS /v1/transcribe

Get the available options for the transcribe route.

POST /v1/detect

Detect the language of the audio file.

Query parameters:

  • OPTIONAL: model: string (default: tiny)

Body:

  • REQUIRED: binary data: Raw data with the audio content to detect the language for

OPTIONS /v1/detect

Get the available options for the detect route.

GET /v1/download/<job_id>

Receive the finished job result as the requested output format.

Query parameters:

  • OPTIONAL: output: string (default: srt)
    • json: JSON response of the model output
    • timecode_txt: Plain text file with timecodes(srt)
    • txt: Plain text file of the detected text
    • vtt: WebVTT file with the detected text
    • srt: WebVTT file with the detected text

OPTIONS /v1/download/<job_id>

Get the available options for the download route.

GET /v1/jobs/<job_id>

Get the status and metadata of the provided job.

GET /v1/queue

Get the available length of the queue as JSON object with the key length.

Webhook response

If using webhook_id in the request parameters you will get a POST to the webhook url of your choice.

The request will contain a X-WAAS-Signature header with a hash that can be used to verify the content. Check tests/test_webhook.py for an example on how to verify this signature using Python on the receiving end.

The post payload will be a json with this content

On success:

{
  "source": "waas",
  "job_id": "09d2832d-cf3e-4719-aea7-1319000ef372",
  "success": true,
  "url": "https://example.com/v1/download/09d2832d-cf3e-4719-aea7-1319000ef372",
  "filename": "untitled-transcription"
}

On failure:

{
  "source": "waas",
  "job_id": "09d2832d-cf3e-4719-aea7-1319000ef372",
  "success": false
}

Contributing

Requirements

Required amount of VRAM depends on the model used. The smallest model is tiny which requires about 1GB of VRAM.

You can see the full list of models here with information about the required VRAM.

The codebase is expected to be compatible with Python 3.8-3.10. This would be the same as the OpenAI Whisper requirements.

Installation

python3 -mvenv .venv
source .venv/bin/activate
pip install -r requirements.txt

Running full setup using docker-compose

First create a .envrc file with the following content:

export BASE_URL=https://example.com
export [email protected]
export EMAIL_SENDER_PASSWORD=example
export EMAIL_SENDER_HOST=smtp.example.com

export DISCLAIMER='This is a <a href="example.com">disclaimer</a>'

export ALLOWED_WEBHOOKS_FILE='allowed_webhooks.json'

Add a json file named allowed_webhooks.json to the root folder of the project. This file is ignored by git. The content should be a list of valid webhooks, urls and your generated tokens like this:

[
  {
    "id": "77c500b2-0e0f-4785-afc7-f94ed529c897",
    "url": "https://myniceserver.com/mywebhook",
    "token": "frKPI6p5LxxpJa8tCvVr=u5NvU66EJCQdybPuEmzKNeyCDul2-zrOx05?LwIhL5N"
  }
]

For testing you could use the https://webhook.site service (as long as you do not post/transcribe private data)

And set the env variable ALLOWED_WEBHOOKS_FILE=allowed_webhooks.json

Then run the following command

docker-compose --env-file .envrc up

This will start three docker containers.

  • redis
  • api running flask fra src
  • worker running rq from src

Using NVIDIA CUDA with docker-compose

If you have a NVIDIA GPU and want to use it with docker-compose, you need to install nvidia-docker.

To enable CUDA support, you need to edit the docker-compose.yml file to use the nvidia runtime:

build:
  context: .
  # use Dockerfile.gpu when using a NVIDIA GPU
  dockerfile: Dockerfile.gpu

You also have to uncomment the device reservation in the docker-compose.yml file:

deploy:
  resources:
    reservations:
      devices:
        - driver: nvidia
          capabilities: [gpu]

Then run the following command as usual:

docker-compose --env-file .envrc up

The worker will now use the GPU acceleration.

Running full setup using devcontainers

Install remote-development extensions (containers) And then in vscode do Devcontainers: open folder in container Then you are inside the api-container and can do stuff

curl

To upload a file called audunspodssounds.mp3 in norwegian from your download directory

With email callback:

curl --location --request POST 'localhost:3000/v1/transcribe?output=vtt&email_callback=test@localhost&language=norwegian&model=large' \
  --header 'Content-Type: audio/mpeg' \
  --data-binary '@/Users/<user>/Downloads/audunspodssounds.mp3'

With webhook callback:

curl --location --request POST 'localhost:3000/v1/transcribe?output=vtt&language=norwegian&model=large&webhook_callback_url=https://myniceserver.something/mywebhookid' \
  --header 'Content-Type: audio/mpeg' \
  --data-binary '@/Users/<user>/Downloads/audunspodssounds.mp3'

Running tests

$ pytest

๐Ÿฅณ Contributing

FAQ

How to fix [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate?

$ /Applications/Python\ 3.7/Install\ Certificates.command

How to run tests outside the docker container?

Make sure you have fired up the Redis using docker-compose and then use:

ENVIRONMENT=test BASE_URL=http://localhost REDIS_URL=redis://localhost:6379 pytest -v

More Repositories

1

jslt

JSON query and transformation language
Java
612
star
2

strongbox

A secret manager for AWS
Java
239
star
3

jsx-pdf

Generate PDFs using JSX! ๐ŸŽฏ
JavaScript
124
star
4

tweet_ui

Flutter package to display tweets from a Twitter API JSON (v1 or v2) on Android and iOS. Support for Tweets with 1-4 photos, Video, GIFs, hashtags, mentions, symbols, urls, quoted Tweets and retweets.
Dart
79
star
5

schibsted-grotesk

The Schibsted Grotesk font
Python
57
star
6

mesoscope

Local Mesos cluster running on top of docker for learning/testing purposes
Shell
34
star
7

meeting-concluder

Record audio from a meeting, then transcribe, conclude and send the conclusion and a piece of advice to Slack
Go
29
star
8

artishock

A tool to investigate Dependency Confusion in Artifactory
Java
23
star
9

triathlon

Java
20
star
10

github-actions-self-hosted-cdk

TypeScript
20
star
11

aws-cost-monitoring

AWS Cost Monitoring terraform module
HCL
17
star
12

ai-academy

A repository for the schibsted ai academy
16
star
13

account-sdk-browser

Schibsted Account SDK for browsers
JavaScript
16
star
14

account-sdk-android

โ›”๏ธ DEPRECATED Schibsted Account SDK for Android
Kotlin
14
star
15

node-token-introspection

Library to introspect token of service following RFC-7662
JavaScript
13
star
16

mesos2iam

Provide IAM credentials to containers running inside a mesos cluster based on environment variable of the container
Go
9
star
17

tests

The tests we give to people we want to work with
JavaScript
9
star
18

eslint-config-schibsted

eslint configurations from Schibsted engineers
JavaScript
9
star
19

deathstar

Because a little chaos is good for you.
TypeScript
8
star
20

sdk-js

SPiD SDK Client for Javascript
JavaScript
7
star
21

sdk-php

SPiD SDK Client for PHP
PHP
6
star
22

account-sdk-ios

โ›”๏ธ DEPRECATED SchibstedAccount SDK for iOS
Swift
6
star
23

spid-tech-docs

Technical documentation for the Schibsted account platform
Clojure
6
star
24

pr_changelog

A script to generate a nice list of changes given two git references.
Ruby
6
star
25

sdk-android

SPiD SDK Client for Android. DEPRECATED: This is deprecated and will not be supported after May 2018. Please refer to https://github.com/schibsted/account-sdk-android instead
Java
6
star
26

next-gen

Next Generation Products
5
star
27

middy-error-handler

Error handler middleware that returns JSON response
JavaScript
5
star
28

krakend-ratelimit

krakend rate limiter
Go
5
star
29

dockermaze-reloaded

Itโ€™s year BD5. The Dockerbot is your only hope of survival in an unknown world. Will you be able to fix it in time?
Go
4
star
30

bigip-to-terraform

Transform running f5 bigip configuration to terraform resources
Python
4
star
31

libvmod-hashids

https://hashids.org/ support for Varnish
C
4
star
32

sdk-example

An example demonstrating usage of SDKs
JavaScript
4
star
33

spid-client-java

Lightweight client for the SPiD API
Java
4
star
34

udp-pipe

Reads UDP packages and forwards to different targets
JavaScript
4
star
35

serverless-slack-deploy-notification

Plugin that sends a slack message on deployment start and finish
JavaScript
4
star
36

sdk-java-event-tracking

Java
3
star
37

SPiDSDK

SPiD SDK Client for iOS
Objective-C
3
star
38

sdk-js-event-tracking-contrib

Automatic tracking layer for the js sdk.
JavaScript
3
star
39

sum

Sum, a powerful tool for enhancing your articles with the help of ChatGPT.
TypeScript
3
star
40

depstrive

Multi-tool for missing CI/CD features
JavaScript
3
star
41

googoo

Deploy review apps for your project using Serverless
JavaScript
3
star
42

spid-php-examples

Using the SPiD API: Working examples for PHP
PHP
3
star
43

deathstar-middleware

Node.js middleware for Deathstar, to create simulated outages
TypeScript
3
star
44

spid-clj-examples

Using the SPiD API: Working examples for Clojure
Clojure
3
star
45

gocd-s3-poller

Poll AWS S3 bucket and folder for files, and trigger pipeline in GoCD
Java
3
star
46

overloadimpact

Command line tool and framework for writing and running tests suites for loadimpact.com, with support for custom lua libraries.
Python
3
star
47

schibsted-account-chrome-extension

Let's you transfer the Schibsted Account cookie to your local projects with ease!
JavaScript
3
star
48

pingdom-status-page

A status page to show off your current and historical uptime from Pingdom
JavaScript
2
star
49

krakend-eureka

krakend eureka integration
Go
2
star
50

discord-news-bot

Stay updated with the latest headlines from VG directly in your Discord server!
TypeScript
2
star
51

chef-rest

Chef resource provider to do REST queries in recipes
Ruby
2
star
52

core-sdk-node

Core SDK for Identity and Payment
JavaScript
2
star
53

VG-Nyhets-Quiz

WIP
TypeScript
2
star
54

problematic

Random problem generator
CSS
2
star
55

account-sdk-flutter

Flutter plugin for Schibsted Account SDK
Kotlin
2
star
56

account-sdk-ios-web

Schibsted account SDK for iOS
Swift
2
star
57

smaug

A simple credentials provider for mesos2iam
Go
2
star
58

slack-calendar-topic

Set the topic of a Slack channel to the currently ongoing event in a Google calendar
JavaScript
2
star
59

sls-oncall-twilio

Call routing with Twilio and PagerDuty
JavaScript
2
star
60

ratpack-datadog

Java
2
star
61

ratpack-eureka

Java
2
star
62

krakend-cbreaker

krakend circuit breaker hystrix style implemetation
Go
2
star
63

spid-client-clojure

A very thin Clojure wrapper for the SPID Java SDK
Clojure
2
star
64

copyfield

Update fields in a PostgreSQL database with values from another column
Go
2
star
65

spid-sdk-client-node

Lightweight Node.js client for the SPiD API
JavaScript
1
star
66

spid-java-examples

Examples using the spid-client-java
Java
1
star
67

sls-oncall

Slack bot that fetches user oncall given a schedule in PagerDuty
JavaScript
1
star
68

middy-caching-headers

Add caching headers to the response e.g. Cache-Control, Surrogate-Control
JavaScript
1
star
69

express-api-formatter

Decorates express response with success/error functions
JavaScript
1
star
70

uka-workshop-2019

Kubernetes Workshop at UKA 2019
1
star
71

homebrew-strongbox

Homebrew recipes
Ruby
1
star
72

docker-postgres-tests

Docker images specialised for testing purposes
Go
1
star
73

tjejer-kodar-schibsted

The project for Schibsted's workshop for Tjejer Kodar at October 2018
JavaScript
1
star
74

middy-cors

Adds CORS headers to the response (success and error)
JavaScript
1
star
75

express-json-error-handler

Error handler for body-parser
JavaScript
1
star
76

configure-convox-racks

JavaScript
1
star
77

sdk-java

SPiD SDK Client for JAVA
Java
1
star
78

eslint-config-schibsted-react

ESLint configs for React.js from Schibsted
JavaScript
1
star
79

strongbox-examples

Usage examples for Strongbox
Java
1
star
80

react-account

React Context Provider and Hook making it easier to use Schibsted Account in your React app
JavaScript
1
star
81

identity-sdk

The identity SDK for Node
JavaScript
1
star
82

cassandra-backup

Stress-free improved Cassandra backups
1
star
83

browser-sdk

[DEPRECATED โ€” DO NOT USE] Schibsted Browser SDK for identity and payment
JavaScript
1
star
84

lambda-slack-app-template

Everything you need to get started on making a Slack App running on AWS Lambda
JavaScript
1
star
85

WAAS-web

HTML
1
star
86

account-sdk-android-web

Schibsted account SDK for Android
Kotlin
1
star