Vishnu-add commited on
Commit
3e6605d
·
1 Parent(s): bbf4827

Upload 53 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +9 -0
  2. README.md +3 -3
  3. Samples/3.mp3 +0 -0
  4. Samples/Bengali_1.wav +0 -0
  5. Samples/Bengali_2.wav +0 -0
  6. Samples/Gujarati_1.wav +0 -0
  7. Samples/Gujarati_2.wav +3 -0
  8. Samples/Hindi_1.mp3 +0 -0
  9. Samples/Hindi_2.mp3 +0 -0
  10. Samples/Hindi_3.mp3 +0 -0
  11. Samples/Hindi_4.mp3 +0 -0
  12. Samples/Hindi_5.mp3 +0 -0
  13. Samples/Malayalam_1.wav +0 -0
  14. Samples/Malayalam_2.wav +0 -0
  15. Samples/Malayalam_3.wav +0 -0
  16. Samples/Marathi_1.mp3 +0 -0
  17. Samples/Marathi_2.mp3 +0 -0
  18. Samples/Marathi_3.mp3 +0 -0
  19. Samples/Montreal Vacation Travel Guide Expedia.mp3 +3 -0
  20. Samples/Nepal_1.mp3 +0 -0
  21. Samples/Nepal_2.mp3 +0 -0
  22. Samples/Nepal_3.mp3 +0 -0
  23. Samples/Que es TED y TEDx.mp3 +3 -0
  24. Samples/Tamil_1.mp3 +0 -0
  25. Samples/Tamil_2.mp3 +0 -0
  26. Samples/Telugu_1.wav +0 -0
  27. Samples/Telugu_2.wav +3 -0
  28. Samples/Telugu_3.wav +0 -0
  29. Samples/climate ex short.wav +0 -0
  30. Samples/emp2.wav +3 -0
  31. Samples/ted_short.wav +0 -0
  32. Samples/test_mixture.wav +3 -0
  33. Samples/test_mixture1.wav +0 -0
  34. app.py +79 -0
  35. packages.txt +4 -0
  36. requirements.txt +2 -0
  37. whisper_blas_bin_v1_3_0/SDL2.dll +3 -0
  38. whisper_blas_bin_v1_3_0/bench.exe +0 -0
  39. whisper_blas_bin_v1_3_0/command.exe +0 -0
  40. whisper_blas_bin_v1_3_0/emp2.wav +3 -0
  41. whisper_blas_bin_v1_3_0/emp2.wav.srt +32 -0
  42. whisper_blas_bin_v1_3_0/libopenblas.dll +3 -0
  43. whisper_blas_bin_v1_3_0/main.exe +0 -0
  44. whisper_blas_bin_v1_3_0/models/ggml-model-gpt-2-117M.bin +3 -0
  45. whisper_blas_bin_v1_3_0/models/ggml-model-whisper-base.bin +3 -0
  46. whisper_blas_bin_v1_3_0/models/ggml-model-whisper-base.en.bin +3 -0
  47. whisper_blas_bin_v1_3_0/models/ggml-model-whisper-medium-q5_0.bin +3 -0
  48. whisper_blas_bin_v1_3_0/models/ggml-model-whisper-small.en.bin +3 -0
  49. whisper_blas_bin_v1_3_0/stream.exe +0 -0
  50. whisper_blas_bin_v1_3_0/talk-llama.exe +0 -0
.gitattributes CHANGED
@@ -33,3 +33,12 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ whisper_blas_bin_v1_3_0/emp2.wav filter=lfs diff=lfs merge=lfs -text
37
+ whisper_blas_bin_v1_3_0/libopenblas.dll filter=lfs diff=lfs merge=lfs -text
38
+ whisper_blas_bin_v1_3_0/SDL2.dll filter=lfs diff=lfs merge=lfs -text
39
+ Samples/emp2.wav filter=lfs diff=lfs merge=lfs -text
40
+ Samples/Montreal[[:space:]]Vacation[[:space:]]Travel[[:space:]]Guide[[:space:]][[:space:]]Expedia.mp3 filter=lfs diff=lfs merge=lfs -text
41
+ Samples/Que[[:space:]]es[[:space:]]TED[[:space:]]y[[:space:]]TEDx.mp3 filter=lfs diff=lfs merge=lfs -text
42
+ Samples/test_mixture.wav filter=lfs diff=lfs merge=lfs -text
43
+ Samples/Gujarati_2.wav filter=lfs diff=lfs merge=lfs -text
44
+ Samples/Telugu_2.wav filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  title: Whisper CPP ASR CLI
3
- emoji: 📊
4
- colorFrom: purple
5
  colorTo: pink
6
  sdk: gradio
7
- sdk_version: 4.1.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
1
  ---
2
  title: Whisper CPP ASR CLI
3
+ emoji: 🚀
4
+ colorFrom: yellow
5
  colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 4.0.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
Samples/3.mp3 ADDED
Binary file (36.8 kB). View file
 
Samples/Bengali_1.wav ADDED
Binary file (129 kB). View file
 
Samples/Bengali_2.wav ADDED
Binary file (129 kB). View file
 
Samples/Gujarati_1.wav ADDED
Binary file (434 kB). View file
 
Samples/Gujarati_2.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d087ac4bc15ddccecbbded4c8fdd2c9501bd8e08c6550f9c03ec46bd2df64da
3
+ size 1597484
Samples/Hindi_1.mp3 ADDED
Binary file (36.5 kB). View file
 
Samples/Hindi_2.mp3 ADDED
Binary file (24.6 kB). View file
 
Samples/Hindi_3.mp3 ADDED
Binary file (39.8 kB). View file
 
Samples/Hindi_4.mp3 ADDED
Binary file (49.5 kB). View file
 
Samples/Hindi_5.mp3 ADDED
Binary file (52.5 kB). View file
 
Samples/Malayalam_1.wav ADDED
Binary file (762 kB). View file
 
Samples/Malayalam_2.wav ADDED
Binary file (729 kB). View file
 
Samples/Malayalam_3.wav ADDED
Binary file (555 kB). View file
 
Samples/Marathi_1.mp3 ADDED
Binary file (30.3 kB). View file
 
Samples/Marathi_2.mp3 ADDED
Binary file (55.1 kB). View file
 
Samples/Marathi_3.mp3 ADDED
Binary file (60.5 kB). View file
 
Samples/Montreal Vacation Travel Guide Expedia.mp3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bc5148bfd0aca841584c6120c9b02c4c3d9aada2e9b015827a7869803b6471cb
3
+ size 8058808
Samples/Nepal_1.mp3 ADDED
Binary file (12.8 kB). View file
 
Samples/Nepal_2.mp3 ADDED
Binary file (31.4 kB). View file
 
Samples/Nepal_3.mp3 ADDED
Binary file (30.3 kB). View file
 
Samples/Que es TED y TEDx.mp3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:120a8f591bec8715dea618a14bf0538ec03444aaf875994bac0d8a1506f2ffdc
3
+ size 1852114
Samples/Tamil_1.mp3 ADDED
Binary file (57.9 kB). View file
 
Samples/Tamil_2.mp3 ADDED
Binary file (49.3 kB). View file
 
Samples/Telugu_1.wav ADDED
Binary file (500 kB). View file
 
Samples/Telugu_2.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ccee4c1d338d4d6fc96dfca5f48ecac3d9b9517e44f0302037fe46304e9e76b0
3
+ size 1122348
Samples/Telugu_3.wav ADDED
Binary file (950 kB). View file
 
Samples/climate ex short.wav ADDED
Binary file (308 kB). View file
 
Samples/emp2.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:133ac69ac8a7d99f1fe92b7dbd810d7f4e44cd4f282179aa8c5d83183e64ad61
3
+ size 1122066
Samples/ted_short.wav ADDED
Binary file (765 kB). View file
 
Samples/test_mixture.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7126269f058724336d28bf6e82fa14b7030de321dbafa48c9fa20884d35dab9d
3
+ size 1546250
Samples/test_mixture1.wav ADDED
Binary file (603 kB). View file
 
app.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import soundfile as sf
3
+ import tempfile
4
+ import shutil
5
+ import os
6
+ import librosa
7
+ import time
8
+ import numpy as np
9
+ import subprocess
10
+
11
+ # command = r"""wine './whisper_blas_bin_v1_3_0/main.exe' -h"""
12
+ # wine_command = """sudo apt-get install wine"""
13
+ command2 = """chmod +777 ./whisper_blas_bin_v1_3_0/main.exe"""
14
+ # wine_c = subprocess.run(wine_command,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
15
+ perm = subprocess.run(command2, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
16
+ # result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
17
+ # print("Wine Installation: ",wine_c)
18
+ print("Access Installation: ",perm)
19
+ # Fpr win32 instalattion while using medium model
20
+ # command3 = "apt install sudo"
21
+ # command4 = "dpkg --add-architecture i386"
22
+ # command5 = "apt-get update"
23
+ # command6 = "apt-get install wine32:i386"
24
+ # t1= subprocess.run(command3, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
25
+ # t2= subprocess.run(command4, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
26
+ # t3= subprocess.run(command5, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
27
+ # t4= subprocess.run(command6, shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE, text=True)
28
+ # print("T1: ",t1)
29
+ # print("T2: ",t2)
30
+ # print("T3: ",t3)
31
+ # print("T4: ",t4)
32
+
33
+
34
+ def resample_to_16k(audio, orig_sr):
35
+ y_resampled = librosa.resample(y=audio, orig_sr=orig_sr, target_sr = 16000)
36
+ return y_resampled
37
+
38
+ def transcribe(audio):
39
+ sr,y = audio
40
+ y = y.astype(np.float32)
41
+ y /= np.max(np.abs(y))
42
+ y_resampled = resample_to_16k(y, sr)
43
+
44
+
45
+ with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as temp_audio:
46
+ temp_audio_path = temp_audio.name
47
+ sf.write(temp_audio_path, y_resampled, 16000)
48
+
49
+
50
+
51
+ # command = rf"""wine './whisper_blas_bin_v1_3_0/main.exe' -m './whisper_blas_bin_v1_3_0/models/ggml-model-whisper-small.en.bin' -osrt -f '{temp_audio_path}' -nt""" # English only
52
+ command = rf"""wine './whisper_blas_bin_v1_3_0/main.exe' -m './whisper_blas_bin_v1_3_0/models/ggml-model-whisper-base.bin' -osrt -f '{temp_audio_path}' -nt""" # Multilingual
53
+ # win32 error while using medium model
54
+ # command = rf"""wine './whisper_blas_bin_v1_3_0/main.exe' -m './whisper_blas_bin_v1_3_0/models/ggml-model-whisper-medium-q5_0.bin' -osrt -f '{temp_audio_path}' -nt""" # Multilingual
55
+
56
+ start_time = time.time()
57
+ result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
58
+ end_time = time.time()
59
+ print("Output",result.stdout)
60
+ print("Error",result.stderr)
61
+ transcription = result.stdout
62
+ print(transcription)
63
+
64
+ print("--------------------------")
65
+ print(f"Execution time: {end_time - start_time} seconds")
66
+ return transcription, (end_time - start_time)
67
+
68
+
69
+
70
+ demo = gr.Interface(
71
+ transcribe,
72
+ inputs = "microphone",
73
+ # gr.Audio(sources=["microphone"]),
74
+ outputs = [gr.Textbox(label="CLI_Transcription"),gr.Textbox(label="Time taken for Transcription")],
75
+ examples=["./Samples/Hindi_1.mp3","./Samples/Hindi_2.mp3","./Samples/Tamil_1.mp3","./Samples/Tamil_2.mp3","./Samples/Marathi_1.mp3","./Samples/Marathi_2.mp3","./Samples/Nepal_1.mp3","./Samples/Nepal_2.mp3","./Samples/Telugu_1.wav","./Samples/Telugu_2.wav","./Samples/Malayalam_1.wav","./Samples/Malayalam_2.wav","./Samples/Gujarati_1.wav","./Samples/Gujarati_2.wav","./Samples/Bengali_1.wav","./Samples/Bengali_2.wav"]
76
+
77
+ )
78
+
79
+ demo.launch()
packages.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ sudo
2
+ wine
3
+ libwine
4
+ wine64
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ librosa
2
+ soundfile
whisper_blas_bin_v1_3_0/SDL2.dll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6130ad170f5d09a8b3bc6c38a6c7a19f7fd840f345ce0f10fd11bd684bfd1c2
3
+ size 2509824
whisper_blas_bin_v1_3_0/bench.exe ADDED
Binary file (19.5 kB). View file
 
whisper_blas_bin_v1_3_0/command.exe ADDED
Binary file (121 kB). View file
 
whisper_blas_bin_v1_3_0/emp2.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:133ac69ac8a7d99f1fe92b7dbd810d7f4e44cd4f282179aa8c5d83183e64ad61
3
+ size 1122066
whisper_blas_bin_v1_3_0/emp2.wav.srt ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 1
2
+ 00:00:00,000 --> 00:00:07,120
3
+ Climate change activists from the last generation movement in Italy climbed into Rome's iconic
4
+
5
+ 2
6
+ 00:00:07,120 --> 00:00:11,520
7
+ Trevi Fountain and used dye to turn its waters black.
8
+
9
+ 3
10
+ 00:00:11,520 --> 00:00:15,960
11
+ They described it as a protest against the inaction of Italy's government and institutions
12
+
13
+ 4
14
+ 00:00:15,960 --> 00:00:17,480
15
+ on climate change.
16
+
17
+ 5
18
+ 00:00:17,480 --> 00:00:22,600
19
+ The group says the continued investment in fossil fuels is directly linked to the catastrophic
20
+
21
+ 6
22
+ 00:00:22,600 --> 00:00:27,120
23
+ flooding that has recently hit Italy's Emilia Ramana region.
24
+
25
+ 7
26
+ 00:00:27,120 --> 00:00:33,040
27
+ This generation's peaceful protests have targeted other cultural sites in the past.
28
+
29
+ 8
30
+ 00:00:33,040 --> 00:00:35,620
31
+ (logo whooshing)
32
+
whisper_blas_bin_v1_3_0/libopenblas.dll ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7f521b507686ddc25bee7538a80c3741d77f5b7b6c12bddf66894e672eebe0b
3
+ size 48536473
whisper_blas_bin_v1_3_0/main.exe ADDED
Binary file (101 kB). View file
 
whisper_blas_bin_v1_3_0/models/ggml-model-gpt-2-117M.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b457d5fcc7f2f71e727bee74298d42d80610619e02af16beca53d44a71d5f607
3
+ size 251222425
whisper_blas_bin_v1_3_0/models/ggml-model-whisper-base.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60ed5bc3dd14eea856493d334349b405782ddcaf0028d4b5df4088345fba2efe
3
+ size 147951465
whisper_blas_bin_v1_3_0/models/ggml-model-whisper-base.en.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a03779c86df3323075f5e796cb2ce5029f00ec8869eee3fdfb897afe36c6d002
3
+ size 147964211
whisper_blas_bin_v1_3_0/models/ggml-model-whisper-medium-q5_0.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19fea4b380c3a618ec4723c3eef2eb785ffba0d0538cf43f8f235e7b3b34220f
3
+ size 539212467
whisper_blas_bin_v1_3_0/models/ggml-model-whisper-small.en.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c6138d6d58ecc8322097e0f987c32f1be8bb0a18532a3f88f734d1bbf9c41e5d
3
+ size 487614201
whisper_blas_bin_v1_3_0/stream.exe ADDED
Binary file (54.3 kB). View file
 
whisper_blas_bin_v1_3_0/talk-llama.exe ADDED
Binary file (414 kB). View file