frimelle HF Staff commited on
Commit
df327d0
·
1 Parent(s): 0d9ff36

try to recreate the code

Browse files
Files changed (2) hide show
  1. src/generate.py +3 -3
  2. src/tts.py +2 -2
src/generate.py CHANGED
@@ -7,8 +7,8 @@ import src.process as process
7
  # You can choose to use either:
8
  # (1) a list of pre-specified sentences, in SENTENCE_BANK
9
  # (2) an LLM-generated sentence.
10
- # SENTENCE_BANK is used in the gen_sentence_set function.
11
- # LLM generation is used in the gen_sentence_llm function.
12
 
13
  # ------------------- Sentence Bank (customize freely) -------------------
14
  SENTENCE_BANK = [
@@ -42,4 +42,4 @@ def gen_sentence_llm():
42
 
43
  def gen_sentence_set():
44
  """Returns a sentence for the user to say using a prespecified set of options."""
45
- return random.choice(SENTENCE_BANK)
 
7
  # You can choose to use either:
8
  # (1) a list of pre-specified sentences, in SENTENCE_BANK
9
  # (2) an LLM-generated sentence.
10
+ # SENTENCE_BANK is used in the `gen_sentence_set` function.
11
+ # LLM generation is used in the `gen_sentence_llm` function.
12
 
13
  # ------------------- Sentence Bank (customize freely) -------------------
14
  SENTENCE_BANK = [
 
42
 
43
  def gen_sentence_set():
44
  """Returns a sentence for the user to say using a prespecified set of options."""
45
+ return random.choice(SENTENCE_BANK)
src/tts.py CHANGED
@@ -1,3 +1,4 @@
 
1
  from __future__ import annotations
2
  from typing import Tuple, Union
3
 
@@ -23,7 +24,6 @@ def run_tts_clone(
23
  ) -> Union[Tuple[int, np.ndarray], Exception]:
24
  """
25
  Synthesize 'text_to_speak' in the cloned voice from 'ref_audio_path'.
26
-
27
  Returns:
28
  (sampling_rate, waveform) on success, or Exception on failure.
29
  """
@@ -39,4 +39,4 @@ def run_tts_clone(
39
  wav = audio["array"].astype(np.float32)
40
  return sr, wav
41
  except Exception as e:
42
- return e
 
1
+ # src/tts.py
2
  from __future__ import annotations
3
  from typing import Tuple, Union
4
 
 
24
  ) -> Union[Tuple[int, np.ndarray], Exception]:
25
  """
26
  Synthesize 'text_to_speak' in the cloned voice from 'ref_audio_path'.
 
27
  Returns:
28
  (sampling_rate, waveform) on success, or Exception on failure.
29
  """
 
39
  wav = audio["array"].astype(np.float32)
40
  return sr, wav
41
  except Exception as e:
42
+ return e