Spaces:
Running
Running
Fish Speech 1.5
Browse files- app.py +10 -9
- test_tts_fish.py +3 -4
app.py
CHANGED
@@ -232,11 +232,11 @@ HF_SPACES = {
|
|
232 |
|
233 |
# Microsoft Edge TTS
|
234 |
'innoai/Edge-TTS-Text-to-Speech': {
|
235 |
-
'name': 'Edge TTS',
|
236 |
'function': '/predict',
|
237 |
'text_param_index': 0,
|
238 |
'return_audio_index': 0,
|
239 |
-
'
|
240 |
'series': 'Edge TTS',
|
241 |
},
|
242 |
|
@@ -245,7 +245,7 @@ HF_SPACES = {
|
|
245 |
'name': 'Fish Speech',
|
246 |
'function': '/inference_wrapper',
|
247 |
'text_param_index': 0,
|
248 |
-
'return_audio_index':
|
249 |
'series': 'Fish Speech',
|
250 |
},
|
251 |
|
@@ -295,6 +295,7 @@ HF_SPACES = {
|
|
295 |
'text_param_index': 0,
|
296 |
'return_audio_index': 0,
|
297 |
'is_zero_gpu_space': True,
|
|
|
298 |
'series': 'StyleTTS',
|
299 |
},
|
300 |
|
@@ -409,7 +410,7 @@ OVERRIDE_INPUTS = {
|
|
409 |
},
|
410 |
|
411 |
'fishaudio/fish-speech-1': {
|
412 |
-
|
413 |
2: handle_file('https://huggingface.co/spaces/fishaudio/fish-speech-1/resolve/main/examples/English.wav'), # reference_audio
|
414 |
3: 'In the ancient land of Eldoria, where the skies were painted with shades of mystic hues and the forests whispered secrets of old, there existed a dragon named Zephyros. Unlike the fearsome tales of dragons that plagued human hearts with terror, Zephyros was a creature of wonder and wisdom, revered by all who knew of his existence.', # reference_text
|
415 |
4: 0, # max_new_tokens
|
@@ -417,8 +418,8 @@ OVERRIDE_INPUTS = {
|
|
417 |
6: 0.7, # top_p
|
418 |
7: 1.2, # repetition_penalty
|
419 |
8: 0.7, # temperature
|
420 |
-
9:
|
421 |
-
10:
|
422 |
},
|
423 |
|
424 |
'mrfakename/E2-F5-TTS': {
|
@@ -475,7 +476,7 @@ voting_users = {
|
|
475 |
# userid as the key and USER() as the value
|
476 |
}
|
477 |
# top five models in order to always have one of them picked and scrutinized
|
478 |
-
top_five = []
|
479 |
|
480 |
def generate_matching_pairs(samples: List[Sample]) -> List[Tuple[Sample, Sample]]:
|
481 |
transcript_groups: Dict[str, List[Sample]] = {}
|
@@ -493,7 +494,7 @@ def generate_matching_pairs(samples: List[Sample]) -> List[Tuple[Sample, Sample]
|
|
493 |
|
494 |
cached_audio = []
|
495 |
|
496 |
-
@spaces.GPU(duration=10)
|
497 |
def asr_cached_for_dataset():
|
498 |
|
499 |
for caudio in cached_audio:
|
@@ -901,7 +902,7 @@ def make_link_to_space(model_name, for_leaderboard=False):
|
|
901 |
try:
|
902 |
if(
|
903 |
for_leaderboard
|
904 |
-
and HF_SPACES[model_name]['
|
905 |
):
|
906 |
model_basename += ' 🔐'
|
907 |
title += '; 🔐 = online only or proprietary'
|
|
|
232 |
|
233 |
# Microsoft Edge TTS
|
234 |
'innoai/Edge-TTS-Text-to-Speech': {
|
235 |
+
'name': 'Microsoft™ Edge TTS',
|
236 |
'function': '/predict',
|
237 |
'text_param_index': 0,
|
238 |
'return_audio_index': 0,
|
239 |
+
'is_closed_off': True,
|
240 |
'series': 'Edge TTS',
|
241 |
},
|
242 |
|
|
|
245 |
'name': 'Fish Speech',
|
246 |
'function': '/inference_wrapper',
|
247 |
'text_param_index': 0,
|
248 |
+
'return_audio_index': 0,
|
249 |
'series': 'Fish Speech',
|
250 |
},
|
251 |
|
|
|
295 |
'text_param_index': 0,
|
296 |
'return_audio_index': 0,
|
297 |
'is_zero_gpu_space': True,
|
298 |
+
'is_closed_off': True,
|
299 |
'series': 'StyleTTS',
|
300 |
},
|
301 |
|
|
|
410 |
},
|
411 |
|
412 |
'fishaudio/fish-speech-1': {
|
413 |
+
1: False, # normalize
|
414 |
2: handle_file('https://huggingface.co/spaces/fishaudio/fish-speech-1/resolve/main/examples/English.wav'), # reference_audio
|
415 |
3: 'In the ancient land of Eldoria, where the skies were painted with shades of mystic hues and the forests whispered secrets of old, there existed a dragon named Zephyros. Unlike the fearsome tales of dragons that plagued human hearts with terror, Zephyros was a creature of wonder and wisdom, revered by all who knew of his existence.', # reference_text
|
416 |
4: 0, # max_new_tokens
|
|
|
418 |
6: 0.7, # top_p
|
419 |
7: 1.2, # repetition_penalty
|
420 |
8: 0.7, # temperature
|
421 |
+
9: 0, #seed
|
422 |
+
10: "never", #use_memory_cache
|
423 |
},
|
424 |
|
425 |
'mrfakename/E2-F5-TTS': {
|
|
|
476 |
# userid as the key and USER() as the value
|
477 |
}
|
478 |
# top five models in order to always have one of them picked and scrutinized
|
479 |
+
top_five = ['fishaudio/fish-speech-1'] # fish 1.5
|
480 |
|
481 |
def generate_matching_pairs(samples: List[Sample]) -> List[Tuple[Sample, Sample]]:
|
482 |
transcript_groups: Dict[str, List[Sample]] = {}
|
|
|
494 |
|
495 |
cached_audio = []
|
496 |
|
497 |
+
# @spaces.GPU(duration=10)
|
498 |
def asr_cached_for_dataset():
|
499 |
|
500 |
for caudio in cached_audio:
|
|
|
902 |
try:
|
903 |
if(
|
904 |
for_leaderboard
|
905 |
+
and HF_SPACES[model_name]['is_closed_off']
|
906 |
):
|
907 |
model_basename += ' 🔐'
|
908 |
title += '; 🔐 = online only or proprietary'
|
test_tts_fish.py
CHANGED
@@ -6,7 +6,6 @@ client = Client("fishaudio/fish-speech-1", hf_token=os.getenv('HF_TOKEN'))
|
|
6 |
# print(printz)
|
7 |
result = client.predict(
|
8 |
text="Please surprise me and speak in whatever voice you enjoy.",
|
9 |
-
enable_reference_audio=True,
|
10 |
reference_audio=handle_file('https://cdn-uploads.huggingface.co/production/uploads/641de0213239b631552713e4/iKHHqWxWy6Zfmp6QP6CZZ.wav'),
|
11 |
reference_text="In the first half of the 20th century, science fiction familiarized the world with the concept of artificially intelligent robots. It began with the “heartless” Tin man from the Wizard of Oz and continued with the humanoid robot that impersonated Maria in Metropolis. By the 1950s, we had a generation of scientists, mathematicians, and philosophers with the concept of artificial intelligence (or AI) culturally assimilated in their minds.",
|
12 |
max_new_tokens=1024,
|
@@ -14,8 +13,8 @@ result = client.predict(
|
|
14 |
top_p=0.7,
|
15 |
repetition_penalty=1.2,
|
16 |
temperature=0.7,
|
17 |
-
|
18 |
-
|
19 |
api_name="/inference_wrapper"
|
20 |
)
|
21 |
-
print(result
|
|
|
6 |
# print(printz)
|
7 |
result = client.predict(
|
8 |
text="Please surprise me and speak in whatever voice you enjoy.",
|
|
|
9 |
reference_audio=handle_file('https://cdn-uploads.huggingface.co/production/uploads/641de0213239b631552713e4/iKHHqWxWy6Zfmp6QP6CZZ.wav'),
|
10 |
reference_text="In the first half of the 20th century, science fiction familiarized the world with the concept of artificially intelligent robots. It began with the “heartless” Tin man from the Wizard of Oz and continued with the humanoid robot that impersonated Maria in Metropolis. By the 1950s, we had a generation of scientists, mathematicians, and philosophers with the concept of artificial intelligence (or AI) culturally assimilated in their minds.",
|
11 |
max_new_tokens=1024,
|
|
|
13 |
top_p=0.7,
|
14 |
repetition_penalty=1.2,
|
15 |
temperature=0.7,
|
16 |
+
seed=0,
|
17 |
+
use_memory_cache="never",
|
18 |
api_name="/inference_wrapper"
|
19 |
)
|
20 |
+
print(result)
|