Spaces:
Running
Running
display q/k/v
Browse files- app.py +2 -2
- audiocraft.py +1 -1
- textual.py +0 -42
app.py
CHANGED
|
@@ -119,7 +119,7 @@ def audionar_tts(text=None,
|
|
| 119 |
background_audio = audiogen.generate(
|
| 120 |
soundscape,
|
| 121 |
duration=target_duration,
|
| 122 |
-
max_tokens=max(4, int(max_tokens)) #
|
| 123 |
).numpy()
|
| 124 |
|
| 125 |
# PAD
|
|
@@ -263,7 +263,7 @@ with gr.Blocks() as demo:
|
|
| 263 |
)
|
| 264 |
choice_dropdown = gr.Dropdown(
|
| 265 |
choices=VOICES + language_names,
|
| 266 |
-
label="Vox",
|
| 267 |
value=VOICES[0]
|
| 268 |
)
|
| 269 |
soundscape_input = gr.Textbox(
|
|
|
|
| 119 |
background_audio = audiogen.generate(
|
| 120 |
soundscape,
|
| 121 |
duration=target_duration,
|
| 122 |
+
max_tokens=min( max(4, int(max_tokens)), 500 ) # limit sounds tokens (clone beyond)
|
| 123 |
).numpy()
|
| 124 |
|
| 125 |
# PAD
|
|
|
|
| 263 |
)
|
| 264 |
choice_dropdown = gr.Dropdown(
|
| 265 |
choices=VOICES + language_names,
|
| 266 |
+
label="Vox:",
|
| 267 |
value=VOICES[0]
|
| 268 |
)
|
| 269 |
soundscape_input = gr.Textbox(
|
audiocraft.py
CHANGED
|
@@ -640,7 +640,7 @@ class StreamingMultiheadAttention(nn.Module):
|
|
| 640 |
|
| 641 |
k = self.k_history
|
| 642 |
v = self.v_history
|
| 643 |
-
|
| 644 |
# -> kv CACHE ONLY APPLIES if not self.cross_attention
|
| 645 |
|
| 646 |
x = torch.nn.functional.scaled_dot_product_attention(
|
|
|
|
| 640 |
|
| 641 |
k = self.k_history
|
| 642 |
v = self.v_history
|
| 643 |
+
print(q.shape, k.shape, v.shape,'Self Atts')
|
| 644 |
# -> kv CACHE ONLY APPLIES if not self.cross_attention
|
| 645 |
|
| 646 |
x = torch.nn.functional.scaled_dot_product_attention(
|
textual.py
CHANGED
|
@@ -157,12 +157,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 157 |
'<': ' mai mic decât ',
|
| 158 |
'>': ' mai mare decât',
|
| 159 |
'%': ' la sută ', # percent (from previous)
|
| 160 |
-
'(': ' paranteză deschisă ',
|
| 161 |
-
')': ' paranteză închisă ',
|
| 162 |
-
'[': ' paranteză pătrată deschisă ',
|
| 163 |
-
']': ' paranteză pătrată închisă ',
|
| 164 |
-
'{': ' acoladă deschisă ',
|
| 165 |
-
'}': ' acoladă închisă ',
|
| 166 |
'≠': ' nu este egal cu ',
|
| 167 |
'≤': ' mai mic sau egal cu ',
|
| 168 |
'≥': ' mai mare sau egal cu ',
|
|
@@ -197,12 +191,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 197 |
'>': ' greater than ',
|
| 198 |
# Additional common math symbols from previous list
|
| 199 |
'%': ' percent ',
|
| 200 |
-
'(': ' open parenthesis ',
|
| 201 |
-
')': ' close parenthesis ',
|
| 202 |
-
'[': ' open bracket ',
|
| 203 |
-
']': ' close bracket ',
|
| 204 |
-
'{': ' open curly brace ',
|
| 205 |
-
'}': ' close curly brace ',
|
| 206 |
'∑': ' sum ',
|
| 207 |
'∫': ' integral ',
|
| 208 |
'√': ' square root of ',
|
|
@@ -239,12 +227,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 239 |
'<': ' manje od ',
|
| 240 |
'>': ' veće od ',
|
| 241 |
'%': ' procenat ',
|
| 242 |
-
'(': ' otvorena zagrada ',
|
| 243 |
-
')': ' zatvorena zagrada ',
|
| 244 |
-
'[': ' otvorena uglasta zagrada ',
|
| 245 |
-
']': ' zatvorena uglasta zagrada ',
|
| 246 |
-
'{': ' otvorena vitičasta zagrada ',
|
| 247 |
-
'}': ' zatvorena vitičasta zagrada ',
|
| 248 |
'∑': ' suma ',
|
| 249 |
'∫': ' integral ',
|
| 250 |
'√': ' kvadratni koren ',
|
|
@@ -309,12 +291,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 309 |
'>': ' größer als',
|
| 310 |
# Additional common math symbols from previous list
|
| 311 |
'%': ' prozent ',
|
| 312 |
-
'(': ' Klammer auf ',
|
| 313 |
-
')': ' Klammer zu ',
|
| 314 |
-
'[': ' eckige Klammer auf ',
|
| 315 |
-
']': ' eckige Klammer zu ',
|
| 316 |
-
'{': ' geschweifte Klammer auf ',
|
| 317 |
-
'}': ' geschweifte Klammer zu ',
|
| 318 |
'∑': ' Summe ',
|
| 319 |
'∫': ' Integral ',
|
| 320 |
'√': ' Quadratwurzel ',
|
|
@@ -348,12 +324,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 348 |
'>': ' supérieur à ',
|
| 349 |
# Add more common math symbols as needed for French
|
| 350 |
'%': ' pour cent ',
|
| 351 |
-
'(': ' parenthèse ouverte ',
|
| 352 |
-
')': ' parenthèse fermée ',
|
| 353 |
-
'[': ' crochet ouvert ',
|
| 354 |
-
']': ' crochet fermé ',
|
| 355 |
-
'{': ' accolade ouverte ',
|
| 356 |
-
'}': ' accolade fermée ',
|
| 357 |
'∑': ' somme ',
|
| 358 |
'∫': ' intégrale ',
|
| 359 |
'√': ' racine carrée ',
|
|
@@ -391,12 +361,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 391 |
'>': ' nagyobb mint ',
|
| 392 |
# Add more common math symbols as needed for Hungarian
|
| 393 |
'%': ' százalék ',
|
| 394 |
-
'(': ' nyitó zárójel ',
|
| 395 |
-
')': ' záró zárójel ',
|
| 396 |
-
'[': ' nyitó szögletes zárójel ',
|
| 397 |
-
']': ' záró szögletes zárójel ',
|
| 398 |
-
'{': ' nyitó kapcsos zárójel ',
|
| 399 |
-
'}': ' záró kapcsos zárójel ',
|
| 400 |
'∑': ' szumma ',
|
| 401 |
'∫': ' integrál ',
|
| 402 |
'√': ' négyzetgyök ',
|
|
@@ -429,12 +393,6 @@ def fix_vocals(text, lang='ron'):
|
|
| 429 |
'>': ' μεῖζον ',
|
| 430 |
# Add more common math symbols as needed for Ancient Greek
|
| 431 |
'%': ' τοῖς ἑκατόν ', # tois hekaton - 'of the hundred'
|
| 432 |
-
'(': ' ἀνοικτὴ παρένθεσις ',
|
| 433 |
-
')': ' κλειστὴ παρένθεσις ',
|
| 434 |
-
'[': ' ἀνοικτὴ ἀγκύλη ',
|
| 435 |
-
']': ' κλειστὴ ἀγκύλη ',
|
| 436 |
-
'{': ' ἀνοικτὴ σγουρὴ ἀγκύλη ',
|
| 437 |
-
'}': ' κλειστὴ σγουρὴ ἀγκύλη ',
|
| 438 |
'∑': ' ἄθροισμα ',
|
| 439 |
'∫': ' ὁλοκλήρωμα ',
|
| 440 |
'√': ' τετραγωνικὴ ῥίζα ',
|
|
|
|
| 157 |
'<': ' mai mic decât ',
|
| 158 |
'>': ' mai mare decât',
|
| 159 |
'%': ' la sută ', # percent (from previous)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
'≠': ' nu este egal cu ',
|
| 161 |
'≤': ' mai mic sau egal cu ',
|
| 162 |
'≥': ' mai mare sau egal cu ',
|
|
|
|
| 191 |
'>': ' greater than ',
|
| 192 |
# Additional common math symbols from previous list
|
| 193 |
'%': ' percent ',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
'∑': ' sum ',
|
| 195 |
'∫': ' integral ',
|
| 196 |
'√': ' square root of ',
|
|
|
|
| 227 |
'<': ' manje od ',
|
| 228 |
'>': ' veće od ',
|
| 229 |
'%': ' procenat ',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
'∑': ' suma ',
|
| 231 |
'∫': ' integral ',
|
| 232 |
'√': ' kvadratni koren ',
|
|
|
|
| 291 |
'>': ' größer als',
|
| 292 |
# Additional common math symbols from previous list
|
| 293 |
'%': ' prozent ',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
'∑': ' Summe ',
|
| 295 |
'∫': ' Integral ',
|
| 296 |
'√': ' Quadratwurzel ',
|
|
|
|
| 324 |
'>': ' supérieur à ',
|
| 325 |
# Add more common math symbols as needed for French
|
| 326 |
'%': ' pour cent ',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
'∑': ' somme ',
|
| 328 |
'∫': ' intégrale ',
|
| 329 |
'√': ' racine carrée ',
|
|
|
|
| 361 |
'>': ' nagyobb mint ',
|
| 362 |
# Add more common math symbols as needed for Hungarian
|
| 363 |
'%': ' százalék ',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
'∑': ' szumma ',
|
| 365 |
'∫': ' integrál ',
|
| 366 |
'√': ' négyzetgyök ',
|
|
|
|
| 393 |
'>': ' μεῖζον ',
|
| 394 |
# Add more common math symbols as needed for Ancient Greek
|
| 395 |
'%': ' τοῖς ἑκατόν ', # tois hekaton - 'of the hundred'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 396 |
'∑': ' ἄθροισμα ',
|
| 397 |
'∫': ' ὁλοκλήρωμα ',
|
| 398 |
'√': ' τετραγωνικὴ ῥίζα ',
|