|
defmodule MedicalTranscription.Application do |
|
|
|
|
|
@moduledoc false |
|
|
|
use Application |
|
|
|
@model_name "openai/whisper-tiny" |
|
|
|
@impl true |
|
def start(_type, _args) do |
|
transcription_serving = |
|
[model_name: @model_name] |
|
|> AudioTagger.Transcriber.prepare_featurizer() |
|
|> AudioTagger.Transcriber.prepare_serving(@model_name) |
|
|
|
children = [ |
|
MedicalTranscriptionWeb.Telemetry, |
|
MedicalTranscription.Repo, |
|
{DNSCluster, |
|
query: Application.get_env(:medical_transcription, :dns_cluster_query) || :ignore}, |
|
{Phoenix.PubSub, name: MedicalTranscription.PubSub}, |
|
|
|
{Finch, name: MedicalTranscription.Finch}, |
|
{ |
|
Nx.Serving, |
|
serving: transcription_serving, |
|
name: TranscriptionServing, |
|
batch_size: 4, |
|
batch_timeout: 100 |
|
}, |
|
|
|
|
|
|
|
MedicalTranscriptionWeb.Endpoint |
|
] |
|
|
|
|
|
|
|
opts = [strategy: :one_for_one, name: MedicalTranscription.Supervisor] |
|
Supervisor.start_link(children, opts) |
|
end |
|
|
|
|
|
|
|
@impl true |
|
def config_change(changed, _new, removed) do |
|
MedicalTranscriptionWeb.Endpoint.config_change(changed, removed) |
|
:ok |
|
end |
|
end |
|
|