JBHF commited on
Commit
9d338ec
1 Parent(s): fff2d46

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +121 -1
app.py CHANGED
@@ -312,6 +312,126 @@ st.write("info.all_language_probs : ", info.all_language_probs)
312
  st.write("len(info.all_language_probs): ", len(info.all_language_probs))
313
  # 99
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  st.write("")
316
 
317
  # st.write("info: ", info)
@@ -633,7 +753,7 @@ st.write("---------------------------------------------------------------------"
633
  # VERTALEN NAAR NEDERLANDS VAN DE CONTENT IN text_to_transcribe:
634
  # (PROBEER OOK EEN 2 STAPS VERTALING: EERST NAAR ENGELS,
635
  # EN DAN DIE ENGELSE TEKST NAAR NEDERLANDS TE VERTALEN.
636
- # DOEL: DE VERTALING VAN OEKRAÏENS (VIA ENGELS) NAAR NEDERLANDS TE VERBETEREB.)
637
  response = chain.invoke({"text": \
638
  """Translate the following text into correct Dutch language
639
  and do not use any other language for your response whatsover or you will get severly punished.
 
312
  st.write("len(info.all_language_probs): ", len(info.all_language_probs))
313
  # 99
314
 
315
+
316
+
317
+ # *******************************************************************************
318
+ # 18-04-2024
319
+ # Houd de originele ingesproken taal vast in variabele OriginalLanguage
320
+ #
321
+ # Whisper Languages
322
+ #
323
+ # ZIE:
324
+ # https://github.com/openai/whisper/blob/main/whisper/tokenizer.py
325
+
326
+ LANGUAGES = {
327
+ "en": "english",
328
+ "zh": "chinese",
329
+ "de": "german",
330
+ "es": "spanish",
331
+ "ru": "russian",
332
+ "ko": "korean",
333
+ "fr": "french",
334
+ "ja": "japanese",
335
+ "pt": "portuguese",
336
+ "tr": "turkish",
337
+ "pl": "polish",
338
+ "ca": "catalan",
339
+ "nl": "dutch",
340
+ "ar": "arabic",
341
+ "sv": "swedish",
342
+ "it": "italian",
343
+ "id": "indonesian",
344
+ "hi": "hindi",
345
+ "fi": "finnish",
346
+ "vi": "vietnamese",
347
+ "he": "hebrew",
348
+ "uk": "ukrainian",
349
+ "el": "greek",
350
+ "ms": "malay",
351
+ "cs": "czech",
352
+ "ro": "romanian",
353
+ "da": "danish",
354
+ "hu": "hungarian",
355
+ "ta": "tamil",
356
+ "no": "norwegian",
357
+ "th": "thai",
358
+ "ur": "urdu",
359
+ "hr": "croatian",
360
+ "bg": "bulgarian",
361
+ "lt": "lithuanian",
362
+ "la": "latin",
363
+ "mi": "maori",
364
+ "ml": "malayalam",
365
+ "cy": "welsh",
366
+ "sk": "slovak",
367
+ "te": "telugu",
368
+ "fa": "persian",
369
+ "lv": "latvian",
370
+ "bn": "bengali",
371
+ "sr": "serbian",
372
+ "az": "azerbaijani",
373
+ "sl": "slovenian",
374
+ "kn": "kannada",
375
+ "et": "estonian",
376
+ "mk": "macedonian",
377
+ "br": "breton",
378
+ "eu": "basque",
379
+ "is": "icelandic",
380
+ "hy": "armenian",
381
+ "ne": "nepali",
382
+ "mn": "mongolian",
383
+ "bs": "bosnian",
384
+ "kk": "kazakh",
385
+ "sq": "albanian",
386
+ "sw": "swahili",
387
+ "gl": "galician",
388
+ "mr": "marathi",
389
+ "pa": "punjabi",
390
+ "si": "sinhala",
391
+ "km": "khmer",
392
+ "sn": "shona",
393
+ "yo": "yoruba",
394
+ "so": "somali",
395
+ "af": "afrikaans",
396
+ "oc": "occitan",
397
+ "ka": "georgian",
398
+ "be": "belarusian",
399
+ "tg": "tajik",
400
+ "sd": "sindhi",
401
+ "gu": "gujarati",
402
+ "am": "amharic",
403
+ "yi": "yiddish",
404
+ "lo": "lao",
405
+ "uz": "uzbek",
406
+ "fo": "faroese",
407
+ "ht": "haitian creole",
408
+ "ps": "pashto",
409
+ "tk": "turkmen",
410
+ "nn": "nynorsk",
411
+ "mt": "maltese",
412
+ "sa": "sanskrit",
413
+ "lb": "luxembourgish",
414
+ "my": "myanmar",
415
+ "bo": "tibetan",
416
+ "tl": "tagalog",
417
+ "mg": "malagasy",
418
+ "as": "assamese",
419
+ "tt": "tatar",
420
+ "haw": "hawaiian",
421
+ "ln": "lingala",
422
+ "ha": "hausa",
423
+ "ba": "bashkir",
424
+ "jw": "javanese",
425
+ "su": "sundanese",
426
+ "yue": "cantonese",
427
+ }
428
+
429
+ # https://stackoverflow.com/questions/47780687/how-to-get-a-specific-value-from-a-python-dictionary
430
+ OriginalLanguage = LANGUAGES[info.language]
431
+ st.write("OriginalLanguage: ", OriginalLanguage)
432
+
433
+ # *******************************************************************************
434
+
435
  st.write("")
436
 
437
  # st.write("info: ", info)
 
753
  # VERTALEN NAAR NEDERLANDS VAN DE CONTENT IN text_to_transcribe:
754
  # (PROBEER OOK EEN 2 STAPS VERTALING: EERST NAAR ENGELS,
755
  # EN DAN DIE ENGELSE TEKST NAAR NEDERLANDS TE VERTALEN.
756
+ # DOEL: DE VERTALING VAN OEKRAÏENS (VIA ENGELS) NAAR NEDERLANDS TE VERBETEREN.)
757
  response = chain.invoke({"text": \
758
  """Translate the following text into correct Dutch language
759
  and do not use any other language for your response whatsover or you will get severly punished.