Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,32 +39,12 @@ SAMPLE_RATE = feature_extractor.sampling_rate
|
|
| 39 |
SEED = 42
|
| 40 |
|
| 41 |
default_text = "Please surprise me and speak in whatever voice you enjoy."
|
| 42 |
-
|
| 43 |
[
|
| 44 |
"मुले बागेत खेळत आहेत आणि पक्षी किलबिलाट करत आहेत.",
|
| 45 |
"Sunita speaks slowly in a calm, moderate-pitched voice, delivering the news with a neutral tone. The recording is very high quality with no background noise.",
|
| 46 |
3.0
|
| 47 |
],
|
| 48 |
-
[
|
| 49 |
-
"ಉದ್ಯಾನದಲ್ಲಿ ಮಕ್ಕಳ ಆಟವಾಡುತ್ತಿದ್ದಾರೆ ಮತ್ತು ಪಕ್ಷಿಗಳು ಚಿಲಿಪಿಲಿ ಮಾಡುತ್ತಿವೆ.",
|
| 50 |
-
"Suresh speaks slowly in a low-pitched, calm voice, with a neutral tone, perfect for narration. The recording is very high quality with no background noise.",
|
| 51 |
-
3.0
|
| 52 |
-
],
|
| 53 |
-
[
|
| 54 |
-
"বাচ্চারা বাগানে খেলছে আর পাখি কিচিরমিচির করছে।",
|
| 55 |
-
"Aditi speaks at a moderate pace and pitch, with a clear, neutral tone and no emotional emphasis. The recording is very high quality with no background noise.",
|
| 56 |
-
3.0
|
| 57 |
-
],
|
| 58 |
-
[
|
| 59 |
-
"పిల్లలు తోటలో ఆడుకుంటున్నారు, పక్షుల కిలకిలరావాలు.",
|
| 60 |
-
"Prakash speaks slowly in a low-pitched, calm voice, with a neutral tone, perfect for narration. The recording is very high quality with no background noise.",
|
| 61 |
-
3.0
|
| 62 |
-
],
|
| 63 |
-
[
|
| 64 |
-
"పిల్లలు తోటలో ఆడుకుంటున్నారు, పక్షుల కిలకిలరావాలు.",
|
| 65 |
-
"Prakash speaks slowly in a low-pitched, calm voice, with a neutral tone, perfect for narration. The recording is very high quality with no background noise.",
|
| 66 |
-
3.0
|
| 67 |
-
],
|
| 68 |
[
|
| 69 |
"This is the best time of my life, Bartley,' she said happily",
|
| 70 |
"A male speaker with a low-pitched voice speaks with a British accent at a fast pace in a small, confined space with very clear audio and an animated tone.",
|
|
@@ -79,16 +59,6 @@ default_text = "Please surprise me and speak in whatever voice you enjoy."
|
|
| 79 |
"बगीचे में बच्चे खेल रहे हैं और पक्षी चहचहा रहे हैं।",
|
| 80 |
"Rohit speaks with a slightly high-pitched voice delivering his words at a slightly slow pace in a small, confined space with a touch of background noise and a quite monotone tone.",
|
| 81 |
3.0
|
| 82 |
-
],
|
| 83 |
-
[
|
| 84 |
-
"കുട്ടികൾ പൂന്തോട്ടത്തിൽ കളിക്കുന്നു, പക്ഷികൾ ചിലയ്ക്കുന്നു.",
|
| 85 |
-
"Anjali speaks with a low-pitched voice delivering her words at a fast pace and an animated tone, in a very spacious environment, accompanied by noticeable background noise.",
|
| 86 |
-
3.0
|
| 87 |
-
],
|
| 88 |
-
[
|
| 89 |
-
"குழந்தைகள் தோட்டத்தில் விளையாடுகிறார்கள், பறவைகள் கிண்டல் செய்கின்றன.",
|
| 90 |
-
"Jaya speaks with a slightly low-pitched, quite monotone voice at a slightly faster-than-average pace in a confined space with very clear audio.",
|
| 91 |
-
3.0
|
| 92 |
]
|
| 93 |
]
|
| 94 |
|
|
@@ -99,26 +69,6 @@ finetuned_examples = [
|
|
| 99 |
"Sunita speaks slowly in a calm, moderate-pitched voice, delivering the news with a neutral tone. The recording is very high quality with no background noise.",
|
| 100 |
3.0
|
| 101 |
],
|
| 102 |
-
[
|
| 103 |
-
"ಉದ್ಯಾನದಲ್ಲಿ ಮಕ್ಕಳ ಆಟವಾಡುತ್ತಿದ್ದಾರೆ ಮತ್ತು ಪಕ್ಷಿಗಳು ಚಿಲಿಪಿಲಿ ಮಾಡುತ್ತಿವೆ.",
|
| 104 |
-
"Suresh speaks slowly in a low-pitched, calm voice, with a neutral tone, perfect for narration. The recording is very high quality with no background noise.",
|
| 105 |
-
3.0
|
| 106 |
-
],
|
| 107 |
-
[
|
| 108 |
-
"বাচ্চারা বাগানে খেলছে আর পাখি কিচিরমিচির করছে।",
|
| 109 |
-
"Aditi speaks at a moderate pace and pitch, with a clear, neutral tone and no emotional emphasis. The recording is very high quality with no background noise.",
|
| 110 |
-
3.0
|
| 111 |
-
],
|
| 112 |
-
[
|
| 113 |
-
"పిల్లలు తోటలో ఆడుకుంటున్నారు, పక్షుల కిలకిలరావాలు.",
|
| 114 |
-
"Prakash speaks slowly in a low-pitched, calm voice, with a neutral tone, perfect for narration. The recording is very high quality with no background noise.",
|
| 115 |
-
3.0
|
| 116 |
-
],
|
| 117 |
-
[
|
| 118 |
-
"పిల్లలు తోటలో ఆడుకుంటున్నారు, పక్షుల కిలకిలరావాలు.",
|
| 119 |
-
"Prakash speaks slowly in a low-pitched, calm voice, with a neutral tone, perfect for narration. The recording is very high quality with no background noise.",
|
| 120 |
-
3.0
|
| 121 |
-
],
|
| 122 |
[
|
| 123 |
"This is the best time of my life, Bartley,' she said happily",
|
| 124 |
"A male speaker with a low-pitched voice speaks with a British accent at a fast pace in a small, confined space with very clear audio and an animated tone.",
|
|
@@ -133,19 +83,9 @@ finetuned_examples = [
|
|
| 133 |
"बगीचे में बच्चे खेल रहे हैं और पक्षी चहचहा रहे हैं।",
|
| 134 |
"Rohit speaks with a slightly high-pitched voice delivering his words at a slightly slow pace in a small, confined space with a touch of background noise and a quite monotone tone.",
|
| 135 |
3.0
|
| 136 |
-
],
|
| 137 |
-
[
|
| 138 |
-
"കുട്ടികൾ പൂന്തോട്ടത്തിൽ കളിക്കുന്നു, പക്ഷികൾ ചിലയ്ക്കുന്നു.",
|
| 139 |
-
"Anjali speaks with a low-pitched voice delivering her words at a fast pace and an animated tone, in a very spacious environment, accompanied by noticeable background noise.",
|
| 140 |
-
3.0
|
| 141 |
-
],
|
| 142 |
-
[
|
| 143 |
-
"குழந்தைகள் தோட்டத்தில் விளையாடுகிறார்கள், பறவைகள் கிண்டல் செய்கின்றன.",
|
| 144 |
-
"Jaya speaks with a slightly low-pitched, quite monotone voice at a slightly faster-than-average pace in a confined space with very clear audio.",
|
| 145 |
-
3.0
|
| 146 |
]
|
| 147 |
]
|
| 148 |
-
|
| 149 |
|
| 150 |
def numpy_to_mp3(audio_array, sampling_rate):
|
| 151 |
# Normalize audio_array if it's floating-point
|
|
|
|
| 39 |
SEED = 42
|
| 40 |
|
| 41 |
default_text = "Please surprise me and speak in whatever voice you enjoy."
|
| 42 |
+
examples = [
|
| 43 |
[
|
| 44 |
"मुले बागेत खेळत आहेत आणि पक्षी किलबिलाट करत आहेत.",
|
| 45 |
"Sunita speaks slowly in a calm, moderate-pitched voice, delivering the news with a neutral tone. The recording is very high quality with no background noise.",
|
| 46 |
3.0
|
| 47 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
[
|
| 49 |
"This is the best time of my life, Bartley,' she said happily",
|
| 50 |
"A male speaker with a low-pitched voice speaks with a British accent at a fast pace in a small, confined space with very clear audio and an animated tone.",
|
|
|
|
| 59 |
"बगीचे में बच्चे खेल रहे हैं और पक्षी चहचहा रहे हैं।",
|
| 60 |
"Rohit speaks with a slightly high-pitched voice delivering his words at a slightly slow pace in a small, confined space with a touch of background noise and a quite monotone tone.",
|
| 61 |
3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
]
|
| 63 |
]
|
| 64 |
|
|
|
|
| 69 |
"Sunita speaks slowly in a calm, moderate-pitched voice, delivering the news with a neutral tone. The recording is very high quality with no background noise.",
|
| 70 |
3.0
|
| 71 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
[
|
| 73 |
"This is the best time of my life, Bartley,' she said happily",
|
| 74 |
"A male speaker with a low-pitched voice speaks with a British accent at a fast pace in a small, confined space with very clear audio and an animated tone.",
|
|
|
|
| 83 |
"बगीचे में बच्चे खेल रहे हैं और पक्षी चहचहा रहे हैं।",
|
| 84 |
"Rohit speaks with a slightly high-pitched voice delivering his words at a slightly slow pace in a small, confined space with a touch of background noise and a quite monotone tone.",
|
| 85 |
3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
]
|
| 87 |
]
|
| 88 |
+
|
| 89 |
|
| 90 |
def numpy_to_mp3(audio_array, sampling_rate):
|
| 91 |
# Normalize audio_array if it's floating-point
|