Pendrokar commited on
Commit
4a483c5
·
1 Parent(s): 2e21b3e

new tts: MARS6

Browse files
Files changed (2) hide show
  1. app/models.py +28 -0
  2. test_tts_mars6.py +50 -0
app/models.py CHANGED
@@ -78,6 +78,12 @@ AVAILABLE_MODELS = {
78
  # llasa 3b TTS
79
  'srinivasbilla/llasa-3b-tts': 'srinivasbilla/llasa-3b-tts',
80
 
 
 
 
 
 
 
81
  # HF TTS w issues
82
  # 'LeeSangHoon/HierSpeech_TTS': 'LeeSangHoon/HierSpeech_TTS', # irresponsive to exclamation marks # 4.29
83
  # 'PolyAI/pheme': '/predict#0', # sleepy HF Space
@@ -363,6 +369,17 @@ HF_SPACES = {
363
  'series': 'llasa 3b',
364
  # 'emoji': '🥵', # requires 300s reserved ZeroGPU!
365
  },
 
 
 
 
 
 
 
 
 
 
 
366
  }
367
 
368
  # for zero-shot TTS - voice sample used by XTTS (11 seconds)
@@ -569,6 +586,17 @@ OVERRIDE_INPUTS = {
569
  'srinivasbilla/llasa-3b-tts': {
570
  'sample_audio_path': handle_file('voice_samples/EN_B00004_S00051_W000213.mp3')
571
  },
 
 
 
 
 
 
 
 
 
 
 
572
  }
573
 
574
 
 
78
  # llasa 3b TTS
79
  'srinivasbilla/llasa-3b-tts': 'srinivasbilla/llasa-3b-tts',
80
 
81
+ # Mars5
82
+ # 'CAMB-AI/mars6-turbo-demo': 'CAMB-AI/mars6-turbo-demo',
83
+
84
+ # Mars6
85
+ # 'CAMB-AI/mars6-turbo-demo': 'CAMB-AI/mars6-turbo-demo',
86
+
87
  # HF TTS w issues
88
  # 'LeeSangHoon/HierSpeech_TTS': 'LeeSangHoon/HierSpeech_TTS', # irresponsive to exclamation marks # 4.29
89
  # 'PolyAI/pheme': '/predict#0', # sleepy HF Space
 
369
  'series': 'llasa 3b',
370
  # 'emoji': '🥵', # requires 300s reserved ZeroGPU!
371
  },
372
+
373
+ # Mars6
374
+ 'CAMB-AI/mars6-turbo-demo': {
375
+ 'name': 'MARS 6',
376
+ 'function': '/inference',
377
+ 'text_param_index': 'text',
378
+ 'return_audio_index': 0,
379
+ 'is_zero_gpu_space': False,
380
+ 'is_closed_source': True,
381
+ 'series': 'llasa 3b',
382
+ },
383
  }
384
 
385
  # for zero-shot TTS - voice sample used by XTTS (11 seconds)
 
586
  'srinivasbilla/llasa-3b-tts': {
587
  'sample_audio_path': handle_file('voice_samples/EN_B00004_S00051_W000213.mp3')
588
  },
589
+
590
+ # MARS 6
591
+ 'CAMB-AI/mars6-turbo-demo': {
592
+ 'reference_audio': DEFAULT_VOICE_SAMPLE,
593
+ 'reference_text': DEFAULT_VOICE_TRANSCRIPT,
594
+ 'ras_K': 10,
595
+ 'ras_t_r': 0.09,
596
+ 'top_p': 0.2,
597
+ 'quality_prefix': "48000",
598
+ 'clone_method': "deep-clone",
599
+ },
600
  }
601
 
602
 
test_tts_mars6.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from test_overrides import _get_param_examples, _override_params
3
+ from gradio_client import Client, file
4
+
5
+ model = "CAMB-AI/mars6-turbo-demo"
6
+ client = Client(model, hf_token=os.getenv('HF_TOKEN'))
7
+ endpoints = client.view_api(all_endpoints=True, print_info=False, return_format='dict')
8
+ # print(endpoints)
9
+
10
+ api_name = '/inference'
11
+ fn_index = None
12
+ end_parameters = None
13
+ text = 'This is what my voice sounds like.'
14
+
15
+ end_parameters = _get_param_examples(
16
+ endpoints['named_endpoints'][api_name]['parameters']
17
+ )
18
+ print(end_parameters)
19
+
20
+
21
+ space_inputs = end_parameters
22
+ # override some or all default parameters
23
+ space_inputs = _override_params(end_parameters, model)
24
+
25
+ if(type(space_inputs) == dict):
26
+ space_inputs['text'] = text
27
+ result = client.predict(
28
+ **space_inputs,
29
+ api_name=api_name,
30
+ fn_index=fn_index
31
+ )
32
+ else:
33
+ space_inputs[0] = text
34
+ result = client.predict(
35
+ *space_inputs,
36
+ api_name=api_name,
37
+ fn_index=fn_index
38
+ )
39
+ # space_inputs = {str(i): value for i, value in enumerate(space_inputs)}
40
+
41
+ print(space_inputs)
42
+ # print(*space_inputs)
43
+ # print(**space_inputs)
44
+
45
+ # result = client.predict(
46
+ # **space_inputs,
47
+ # api_name=api_name,
48
+ # fn_index=fn_index
49
+ # )
50
+ print(result)