omarelsayeed commited on
Commit
b996efe
0 Parent(s):

Duplicate from omarelsayeed/eqlab_elnoon_weltanween

Browse files
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Noon-Meem-Moshadada
3
+ emoji: 🐠
4
+ colorFrom: gray
5
+ colorTo: pink
6
+ sdk: gradio
7
+ sdk_version: 3.12.0
8
+ app_file: app.py
9
+ pinned: false
10
+ duplicated_from: omarelsayeed/eqlab_elnoon_weltanween
11
+ python_version: 3.8.5
12
+ ---
13
+
14
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import speech_recognition as sr
2
+ from pydub import AudioSegment
3
+ import soundfile
4
+ import pyrebase
5
+ from pydub import AudioSegment
6
+ import soundfile
7
+ import os
8
+ import pyrebase
9
+ import gradio as gr
10
+ from transformers import AutoProcessor
11
+ from transformers import Wav2Vec2ForCTC
12
+ import gradio as gr
13
+ import torch
14
+ import torchaudio
15
+ from transformers import pipeline
16
+
17
+ classifier = pipeline("audio-classification", model="omarelsayeed/eqlab_elnoon_weltanween")
18
+
19
+
20
+ def recite_wav(path_name):
21
+ # fix pcm_16 error
22
+ # data, samplerate = soundfile.read(path_name)
23
+ # soundfile.write('_.wav', data , samplerate , subtype='PCM_16')
24
+ return classifier(path_name)
25
+
26
+
27
+ def list_all_files():
28
+ for _file in storage.child("wavfiles").list_files():
29
+ print(_file.name)
30
+
31
+ def download_wav_file(wav_name):
32
+ storage.child("wavfiles").child(wav_name).download("xd.wav")
33
+
34
+ def get_quran_text(wav_file_path):
35
+ download_wav_file(wav_file_path)
36
+ recitation = recite_wav("xd.wav")
37
+ os.remove("xd.wav")
38
+ return recitation
39
+
40
+ firebaseConfig = {
41
+ "apiKey": "AIzaSyDjgBD762KveE8GBO7jqTTkj_mKhUTDwGM",
42
+ "authDomain": "quran-c5cbe.firebaseapp.com",
43
+ "databaseURL":"quran-c5cbe.firebaseio.com/",
44
+ "projectId": "quran-c5cbe",
45
+ "storageBucket": "quran-c5cbe.appspot.com",
46
+ "serviceAccount":"quran-c5cbe-firebase-adminsdk-jvpbe-cebaf5aaa6.json"
47
+ }
48
+
49
+ firebase = pyrebase.initialize_app(firebaseConfig)
50
+
51
+ storage = firebase.storage()
52
+
53
+ iface = gr.Interface(fn=get_quran_text, inputs="text", outputs="text")
54
+
55
+ iface.launch()
quran-c5cbe-firebase-adminsdk-jvpbe-cebaf5aaa6.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "service_account",
3
+ "project_id": "quran-c5cbe",
4
+ "private_key_id": "cebaf5aaa614c4f7de734c7b91c3de8f75609527",
5
+ "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCdW5THKfOg7wiz\nPKlpaUpwoGtt0o8/1Vc77DQUkoRvvAmk/SlL1dP24Fgq1LRPLj9dlQ2xtOcU+KRh\nTbUDCj7u/HkEzGZVLwDcUZjul8QJqzw5PCXjYoVjGgd6PKaotQut4QJgwPjZOZlN\nlfMbNoZCu/acwCvIirrjcc3AHooP6w3jBQaRGh6dsn2gpD7JCTHdr8/XQqPH6jtB\nF1Ph+QO/Gglj9SD0VGQsnGNvOdXIofhkcyuaQCJ1l38R67cfiWiF82uuCjEdskKU\naTBn5kX0u9UE3gQGtR1YQ0+rZ7uk7/8hEteJha5ST7JhxGUuTaHuUn8ab17iRrdj\n9N93paABAgMBAAECggEAMEfFIkaQ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\nd5SNhr/ZKylCzExBLTnveodRVMwFM5Mw1IVVii/PAFHqRWQ4tRoCGHz8xdHidaH3\nYS0pnizM2Tp8SZM8MwxO525M3H15rOnDJyijXafcgxYkV1kuTw4a/J+43BmvTibp\n3j58DaalumS2KnCsLOqpLTk=\n-----END PRIVATE KEY-----\n",
6
+ "client_email": "firebase-adminsdk-jvpbe@quran-c5cbe.iam.gserviceaccount.com",
7
+ "client_id": "115841587401667015534",
8
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
9
+ "token_uri": "https://oauth2.googleapis.com/token",
10
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-jvpbe%40quran-c5cbe.iam.gserviceaccount.com"
12
+ }
requirements.txt ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ pyrebase
2
+ gradio
3
+ speechRecognition
4
+ pydub
5
+ soundfile
6
+ torch
7
+ torchaudio
8
+ transformers
9
+ pyctcdecode
10
+ gradio
11
+ kenlm