feat(whisper-asr-webservice) add whisper-asr-webservice (#9198)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [X] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [X] ⚖️ My code follows the style guidelines of this project
- [X] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [X] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [X] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._

---------

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Xstar97TheNoob 2023-06-01 16:53:07 -04:00 committed by GitHub
parent f914d65400
commit 6350715250
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 322 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
# docs folder
/docs
# icon
icon.png

View File

@ -0,0 +1 @@
# Changelog

View File

@ -0,0 +1,28 @@
apiVersion: v2
appVersion: "1.1.0"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 12.10.4
deprecated: false
description: Whisper is a general-purpose speech recognition model.
home: https://truecharts.org/charts/incubator/whisper-asr-webservice
icon: https://truecharts.org/img/hotlink-ok/chart-icons/whisper-asr-webservice.png
keywords:
- whisper-asr-webservice
- machine-learning
kubeVersion: ">=1.16.0-0"
maintainers:
- email: info@truecharts.org
name: TrueCharts
url: https://truecharts.org
name: whisper-asr-webservice
sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/whisper-asr-webservice
- https://github.com/ahmetoner/whisper-asr-webservice
type: application
version: 0.0.1
annotations:
truecharts.org/catagories: |
- machine-learning
truecharts.org/SCALE-support: "true"

View File

@ -0,0 +1 @@
# README

View File

@ -0,0 +1,37 @@
# Installation Notes
A quick run down on the options available for **whisper-asr-webservice**.
The main service runs a Interactive Swagger API documentation is available at <http://truenas.local:19900/docs>
## Models
The **ASR Model** has the following values:
| Model | Required VRAM | Relative speed |
|---------|--------------|----------------|
| tiny | ~1 GB | ~32x |
| base | ~1 GB | ~16x |
| small | ~2 GB | ~6x |
| medium | ~5 GB | ~2x |
| large | ~10 GB | ~1x |
Default is **Base**.
## Engines
The **ASR Engine** is default to **Faster Whisper**, explained [here](https://github.com/guillaumekln/faster-whisper#faster-whisper-transcription-with-ctranslate2).
A list of Engines available.
| Engines |
|--------------------|
| Faster Whisper |
| OpenAI Whisper |
## Cache
> The ASR model is downloaded each time you start the container, using the large model this can take some time. If you want to decrease the time it takes to start your container by skipping the download, you can store the cache directory (/root/.cache/whisper) to an persistent storage. Next time you start your container the ASR Model will be taken from the cache instead of being downloaded again.
Important this will prevent you from receiving any updates to the models.
You can set the pre-persisted mount **whisper** as emptyDir and set it as default or memory if you have the ram for it.

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -0,0 +1,162 @@
# Include{groups}
portals:
open:
# Include{portalLink}
questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
- variable: imageSelector
label: Select Image
schema:
type: string
default: image
enum:
- value: image
description: CPU
- value: gpuImage
description: GPU
- variable: env
label: Image Environment
schema:
additional_attrs: true
type: dict
attrs:
- variable: ASR_MODEL
label: ASR Model
schema:
type: string
required: true
default: base
enum:
- value: tiny
description: Tiny
- value: base
description: Base
- value: small
description: Small
- value: medium
description: Medium
- value: large
description: Large
- value: large-v1
description: Large V1
- value: large-v2
description: Large V2
- variable: ASR_ENGINE
label: ASR Engine
schema:
type: string
required: true
default: faster_whisper
enum:
- value: openai_whisper
description: OpenAI Whisper
- value: faster_whisper
description: Faster Whisper
# Include{containerBasic}
# Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
# Include{serviceRoot}
# Include{serviceMain}
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
label: "Main Service Port Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 19900
required: true
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{persistenceRoot}
- variable: pip
label: "App Pip Storage"
description: "Stores the Application Pip."
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
- variable: poetry
label: "App Poetry Storage"
description: "Stores the Application Poetry."
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
- variable: whisper
label: "App Whisper Storage"
description: "Stores the Application Whisper."
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
- variable: faster-whisper
label: "App Faster Whisper Storage"
description: "Stores the Application Faster Whisper."
schema:
additional_attrs: true
type: dict
attrs:
# Include{persistenceBasic}
# Include{persistenceList}
# Include{ingressRoot}
- variable: main
label: "Main Ingress"
schema:
additional_attrs: true
type: dict
attrs:
# Include{ingressDefault}
# Include{ingressTLS}
# Include{ingressTraefik}
# Include{ingressList}
# Include{securityContextRoot}
- variable: runAsUser
label: "runAsUser"
description: "The UserID of the user running the application"
schema:
type: int
default: 0
- variable: runAsGroup
label: "runAsGroup"
description: "The groupID this App of the user running the application"
schema:
type: int
default: 0
# Include{securityContextContainer}
# Include{securityContextAdvanced}
# Include{securityContextPod}
- variable: fsGroup
label: "fsGroup"
description: "The group that should own ALL storage."
schema:
type: int
default: 568
# Include{resources}
# Include{advanced}
# Include{addons}
# Include{codeserver}
# Include{netshoot}
# Include{vpn}
# Include{documentation}

View File

@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@ -0,0 +1 @@
{{ include "tc.v1.common.loader.all" . }}

View File

@ -0,0 +1,61 @@
image:
repository: tccr.io/truecharts/whisper-asr-webservice-cpu
pullPolicy: IfNotPresent
tag: v1.1.0@sha256:d23d734490bb8ae57d19d7c93965f213e9f96fb6f85b10c01f2f10ecec2e19f4
gpuImage:
repository: tccr.io/truecharts/whisper-asr-webservice-gpu
pullPolicy: IfNotPresent
tag: v1.1.0@sha256:39851411e99bbc02488d994f9d077197d8ef536e251e941006f5e0f65cb55461
securityContext:
container:
readOnlyRootFilesystem: false
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
workload:
main:
podSpec:
containers:
main:
imageSelector: image
probes:
liveness:
type: http
path: "/docs"
readiness:
type: http
path: "/docs"
startup:
type: http
path: "/docs"
env:
ASR_MODEL: tiny
ASR_ENGINE: faster_whisper
service:
main:
ports:
main:
protocol: http
targetPort: 9000
port: 19900
persistence:
pip:
enabled: true
mountPath: "/root/.cache/pip"
poetry:
enabled: true
mountPath: "/root/.cache/poetry"
whisper:
enabled: true
mountPath: "/root/.cache/whisper"
faster-whisper:
enabled: true
mountPath: "/root/.cache/faster_whisper"
portal:
open:
enabled: true