code: def predict_from_text(
      response,
      chatbot_role,
      language,
      roles_map,
      tts_speed,
      model=None,
      supported_languages=None,
      return_as_byte=True,
      sr=24000,
      verbose=False,
  ):
      if chatbot_role == "None":
          return
      audio0 = prepare_speech(sr=sr)
      yield audio0
      latent = get_latent(roles_map[chatbot_role], model=model)
      sentence_state = init_sentence_state()
      generate_speech_func = functools.partial(
          generate_speech,
          model=model,
          language=language,
          supported_languages=supported_languages,
          latent=latent,
          sentence_state=sentence_state,
          return_as_byte=return_as_byte,
          sr=sr,
          tts_speed=tts_speed,
          verbose=verbose,
      )
      while True:
          audio1, sentence, sentence_state = generate_speech_func(
              response, is_final=False
          )
          if sentence is not None:
              yield audio1
          else:
              break
  
      audio1, sentence, sentence_state = generate_speech_func(
          response, is_final=True
      )
      yield audio1
  
imports: from __future__ import annotations
  import functools
  import io
  import os
  import tempfile
  import numpy
  import uuid
  import subprocess
  import time
  from src.tts_sentence_parsing import init_sentence_state, get_sentence, clean_sentence, detect_language
  from src.tts_utils import prepare_speech, get_no_audio, chunk_speed_change
  from src.utils import cuda_vis_check
  import torch
label_desc: Use image node_id 10 for calling a global function with example usage: predict_from_text(response, chatbot_role, language, roles_map, tts_speed, model, supported_languages, return_as_byte, sr, verbose) without return types