{"id":13523327,"url":"https://github.com/schibsted/WAAS","last_synced_at":"2025-04-01T00:31:37.087Z","repository":{"id":62306665,"uuid":"550775432","full_name":"schibsted/WAAS","owner":"schibsted","description":"Whisper as a Service (GUI and API with queuing for OpenAI Whisper)","archived":false,"fork":false,"pushed_at":"2024-10-26T01:54:09.000Z","size":30880,"stargazers_count":1830,"open_issues_count":36,"forks_count":94,"subscribers_count":21,"default_branch":"main","last_synced_at":"2024-10-26T22:23:09.742Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schibsted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-13T09:59:25.000Z","updated_at":"2024-10-25T05:22:10.000Z","dependencies_parsed_at":"2022-10-30T12:00:34.895Z","dependency_job_id":"3941892c-2a78-4781-9348-426ed7a16541","html_url":"https://github.com/schibsted/WAAS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2FWAAS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2FWAAS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2FWAAS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schibsted%2FWAAS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schibsted","download_url":"https://codeload.github.com/schibsted/WAAS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222688173,"owners_count":17023297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:00:58.974Z","updated_at":"2024-11-02T07:31:36.274Z","avatar_url":"https://github.com/schibsted.png","language":"JavaScript","funding_links":[],"categories":["Install from Source","JavaScript","Applications","Web apps","🤖 AI \u0026 Machine Learning"],"sub_categories":["Text-To-Speech Synthesis (TTS)","Self-hosted"],"readme":"# WaaS - Whisper as a Service\n\nGUI and API for [OpenAI Whisper](https://github.com/openai/whisper)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/195266/218677028-632f0a49-c089-486a-ad7f-418c07214876.png\" /\u003e\n  \u003cvideo src=\"https://user-images.githubusercontent.com/544388/219612413-5e84183c-4ce0-4033-ae18-4e5dca740909.mov\"\u003eNo video support\u003c/video\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/schibsted/WAAS/graphs/contributors\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/contributors/schibsted/WAAS?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schibsted/WAAS/stargazers\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/stars/schibsted/WAAS?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schibsted/WAAS/network/members\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/forks/schibsted/WAAS?style=for-the-badge\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schibsted/WAAS/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/schibsted/WAAS?style=for-the-badge\" alt=\"WAAS is released under the Apache-2.0 license\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schibsted/WAAS/issues?q=is:issue+sort:updated-desc+is:open\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues-raw/schibsted/WAAS?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/schibsted/WAAS/issues?q=is:issue+sort:updated-desc+is:closed\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/issues-closed-raw/schibsted/WAAS?style=for-the-badge\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## What is Jojo?\n\nJojo is a GUI for upload and transcribe a audio or video file. After the transcription is done you get an email with download links.\nYou 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).\n\n### Editor\n\nThe 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.\n\n## This project started out by VG\n\n\u003cimg src=\"https://imbo.vgc.no/s/rUWUC9P\" /\u003e\n\n## API Documentation\n\n### POST `/v1/transcribe`\n\nAdd a new transcribe job to the queue. The job will be processed by the worker asynchroniously.\n\nThe response will be a JSON object with `job_id` that can be used to check the status of the job.\n\nQuery parameters:\n\n- REQUIRED: `email_callback`: string or `webhook_id`: string\n- OPTIONAL: `language`: string (default: automatic detection)\n- OPTIONAL: `model`: string (default: `tiny`)\n- OPTIONAL: `task`: string (default: `transcribe`)\n  - `transcribe`: Transcribe audio to text\n  - `translate`: Transcribe then translate audio to text\n- OPTIONAL: `filename`: string (default: `untitled-transcription`)\n\nBody:\n\n- REQUIRED: `binary data`: Raw data with the audio content to transcribe\n\n### OPTIONS `/v1/transcribe`\n\nGet the available options for the transcribe route.\n\n### POST `/v1/detect`\n\nDetect the language of the audio file.\n\nQuery parameters:\n\n- OPTIONAL: `model`: string (default: `tiny`)\n\nBody:\n\n- REQUIRED: `binary data`: Raw data with the audio content to detect the language for\n\n### OPTIONS `/v1/detect`\n\nGet the available options for the detect route.\n\n### GET `/v1/download/\u003cjob_id\u003e`\n\nReceive the finished job result as the requested output format.\n\nQuery parameters:\n\n- OPTIONAL: `output`: string (default: `srt`)\n  - `json`: JSON response of the model output\n  - `timecode_txt`: Plain text file with timecodes(srt)\n  - `txt`: Plain text file of the detected text\n  - `vtt`: WebVTT file with the detected text\n  - `srt`: WebVTT file with the detected text\n\n### OPTIONS `/v1/download/\u003cjob_id\u003e`\n\nGet the available options for the download route.\n\n### GET `/v1/jobs/\u003cjob_id\u003e`\n\nGet the status and metadata of the provided job.\n\n### GET `/v1/queue`\n\nGet the available length of the queue as JSON object with the key `length`.\n\n### Webhook response\n\nIf using `webhook_id` in the request parameters you will get a `POST` to the webhook url of your choice.\n\nThe request will contain a `X-WAAS-Signature` header with a hash that can be used to verify the content.\nCheck `tests/test_webhook.py` for an example on how to verify this signature using Python on the receiving end.\n\nThe post payload will be a json with this content\n\nOn success:\n\n```\n{\n  \"source\": \"waas\",\n  \"job_id\": \"09d2832d-cf3e-4719-aea7-1319000ef372\",\n  \"success\": true,\n  \"url\": \"https://example.com/v1/download/09d2832d-cf3e-4719-aea7-1319000ef372\",\n  \"filename\": \"untitled-transcription\"\n}\n```\n\nOn failure:\n\n```\n{\n  \"source\": \"waas\",\n  \"job_id\": \"09d2832d-cf3e-4719-aea7-1319000ef372\",\n  \"success\": false\n}\n```\n\n## Contributing\n\n## Requirements\n\nRequired amount of VRAM depends on the model used. The smallest model is `tiny` which requires about 1GB of VRAM.\n\nYou can see the [full list of models here](https://github.com/openai/whisper#available-models-and-languages) with information about the required VRAM.\n\nThe codebase is expected to be compatible with Python 3.8-3.10. This would be the same as the [OpenAI Whisper](https://github.com/openai/whisper#setup) requirements.\n\n### Installation\n\n```sh\npython3 -mvenv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\n```\n\n### Running full setup using docker-compose\n\nFirst create a `.envrc` file with the following content:\n\n```sh\nexport BASE_URL=https://example.com\nexport EMAIL_SENDER_ADDRESS=example@example.com\nexport EMAIL_SENDER_PASSWORD=example\nexport EMAIL_SENDER_HOST=smtp.example.com\n\nexport DISCLAIMER='This is a \u003ca href=\"example.com\"\u003edisclaimer\u003c/a\u003e'\n\nexport ALLOWED_WEBHOOKS_FILE='allowed_webhooks.json'\n```\n\nAdd a json file named `allowed_webhooks.json` to the root folder of the project. This file is ignored by git.\nThe content should be a list of valid webhooks, urls and your generated tokens like this:\n\n```\n[\n  {\n    \"id\": \"77c500b2-0e0f-4785-afc7-f94ed529c897\",\n    \"url\": \"https://myniceserver.com/mywebhook\",\n    \"token\": \"frKPI6p5LxxpJa8tCvVr=u5NvU66EJCQdybPuEmzKNeyCDul2-zrOx05?LwIhL5N\"\n  }\n]\n```\n\nFor testing you could use the https://webhook.site service (as long as you do not post/transcribe private data)\n\nAnd set the env variable `ALLOWED_WEBHOOKS_FILE=allowed_webhooks.json`\n\nThen run the following command\n\n```sh\ndocker-compose --env-file .envrc up\n```\n\nThis will start three docker containers.\n\n- redis\n- api running flask fra src\n- worker running rq from src\n\n### Using NVIDIA CUDA with docker-compose\n\nIf you have a NVIDIA GPU and want to use it with docker-compose,\nyou need to install [nvidia-docker](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker).\n\nTo enable CUDA support, you need to edit the `docker-compose.yml` file to use the `nvidia` runtime:\n\n```yaml\nbuild:\n  context: .\n  # use Dockerfile.gpu when using a NVIDIA GPU\n  dockerfile: Dockerfile.gpu\n```\n\nYou also have to uncomment the device reservation in the `docker-compose.yml` file:\n\n```yaml\ndeploy:\n  resources:\n    reservations:\n      devices:\n        - driver: nvidia\n          capabilities: [gpu]\n```\n\nThen run the following command as usual:\n\n```sh\ndocker-compose --env-file .envrc up\n```\n\nThe worker will now use the GPU acceleration.\n\n### Running full setup using devcontainers\n\nInstall remote-development extensions (containers)\nAnd then in vscode do `Devcontainers: open folder in container`\nThen you are inside the api-container and can do stuff\n\n### curl\n\nTo upload a file called audunspodssounds.mp3 in norwegian from your download directory\n\nWith email callback:\n\n```sh\ncurl --location --request POST 'localhost:3000/v1/transcribe?output=vtt\u0026email_callback=test@localhost\u0026language=norwegian\u0026model=large' \\\n  --header 'Content-Type: audio/mpeg' \\\n  --data-binary '@/Users/\u003cuser\u003e/Downloads/audunspodssounds.mp3'\n```\n\nWith webhook callback:\n\n```sh\ncurl --location --request POST 'localhost:3000/v1/transcribe?output=vtt\u0026language=norwegian\u0026model=large\u0026webhook_callback_url=https://myniceserver.something/mywebhookid' \\\n  --header 'Content-Type: audio/mpeg' \\\n  --data-binary '@/Users/\u003cuser\u003e/Downloads/audunspodssounds.mp3'\n```\n\n### Running tests\n\n```bash\n$ pytest\n```\n\n## 🥳 Contributing\n\n\u003ca href=\"https://github.com/schibsted/WAAS/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=schibsted/WAAS\" /\u003e\n\u003c/a\u003e\n\n## FAQ\n\n### How to fix `[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate`?\n\n```sh\n$ /Applications/Python\\ 3.7/Install\\ Certificates.command\n```\n\n### How to run tests outside the docker container?\n\nMake sure you have fired up the Redis using docker-compose and then use:\n\n`ENVIRONMENT=test BASE_URL=http://localhost REDIS_URL=redis://localhost:6379 pytest -v `\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschibsted%2FWAAS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschibsted%2FWAAS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschibsted%2FWAAS/lists"}