Class: Informers::TextToAudioPipeline

Inherits:
Pipeline
  • Object
show all
Defined in:
lib/informers/pipelines.rb

Constant Summary collapse

DEFAULT_VOCODER_ID =
"Xenova/speecht5_hifigan"

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ TextToAudioPipeline

Returns a new instance of TextToAudioPipeline.



804
805
806
807
808
809
# File 'lib/informers/pipelines.rb', line 804

def initialize(**options)
  super(**options)

  # TODO: Find a better way for `pipeline` to set the default vocoder
  @vocoder = options[:vocoder]
end

Instance Method Details

#call(text_inputs, speaker_embeddings: nil) ⇒ Object



811
812
813
814
815
816
817
818
# File 'lib/informers/pipelines.rb', line 811

def call(text_inputs, speaker_embeddings: nil)
  # If this.processor is not set, we are using a `AutoModelForTextToWaveform` model
  if @processor
    call_text_to_spectrogram(text_inputs, speaker_embeddings:)
  else
    call_text_to_waveform(text_inputs)
  end
end