shukdevdatta123 commited on
Commit
62ceb37
·
verified ·
1 Parent(s): 8e066ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -45,10 +45,9 @@ def predict(text, voice='af_heart', speed=1):
45
  return generate_first(text, voice, speed, use_gpu=False)[0]
46
 
47
  def tokenize_first(text, voice='af_heart'):
48
- pipeline = pipelines[voice[0]]
49
- for _, ps, _ in pipeline(text, voice):
50
- return ps
51
- return ''
52
 
53
  def generate_all(text, voice='af_heart', speed=1, use_gpu=CUDA_AVAILABLE):
54
  text = text if CHAR_LIMIT is None else text.strip()[:CHAR_LIMIT]
 
45
  return generate_first(text, voice, speed, use_gpu=False)[0]
46
 
47
  def tokenize_first(text, voice='af_heart'):
48
+ # Split the input text into words and return as a list
49
+ words = text.split()
50
+ return ' '.join(words) # Return the words as a space-separated string
 
51
 
52
  def generate_all(text, voice='af_heart', speed=1, use_gpu=CUDA_AVAILABLE):
53
  text = text if CHAR_LIMIT is None else text.strip()[:CHAR_LIMIT]