Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- ressources/e2e_model/squeezeformer +2 -2
- ressources/kenLM_model/kab_5k_6-gram.bin +2 -2
- ressources/kenLM_model/kab_5k_6-gram_v2.bin +2 -2
- ressources/kenLM_model/kab_5k_trigram.bin +2 -2
- ressources/tokenizer/128_v7.model +2 -2
- ressources/tokenizer/5K.model +2 -2
- ressources/train.csv +2 -2
- src/inference_file.py +6 -1
ressources/e2e_model/squeezeformer
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e044c35cc4ec67b5f31b6d2c5c0d88b35260ec4230b4681c06a125fb4c26946
|
| 3 |
+
size 133
|
ressources/kenLM_model/kab_5k_6-gram.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5997204a01a5b77af19b3fb97a443abf99ce187e4cf6bb80ce20b6fb60e49a3a
|
| 3 |
+
size 132
|
ressources/kenLM_model/kab_5k_6-gram_v2.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:031b9844ae8c586a44b7b271629fe8ee242ff4e55519de98b83bee1e84d229db
|
| 3 |
+
size 133
|
ressources/kenLM_model/kab_5k_trigram.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1d49064d3be8455bc04c87a95371fbc9823e01cb88a00ed32eb06a2d45982dd
|
| 3 |
+
size 132
|
ressources/tokenizer/128_v7.model
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b6ab83ef6996f24e285c1d1acb8fbec87b857412bfd65ebd7a656b9033fea15
|
| 3 |
+
size 131
|
ressources/tokenizer/5K.model
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f95318dba0f4ee4bbe5ab99d8148d577d603479ffd92f973b79bcb456732544
|
| 3 |
+
size 131
|
ressources/train.csv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:063513ebb954b4fba411d96779a19598374cf1a237a0326e199cf40d7b3e9f2d
|
| 3 |
+
size 133
|
src/inference_file.py
CHANGED
|
@@ -8,7 +8,7 @@ import kenlm
|
|
| 8 |
from torchaudio.models.decoder import ctc_decoder
|
| 9 |
from torchaudio.transforms import Resample
|
| 10 |
from squeezeformer import MySqueezeformer
|
| 11 |
-
|
| 12 |
|
| 13 |
# -------------------------
|
| 14 |
# Paths
|
|
@@ -34,6 +34,11 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
| 34 |
model = MySqueezeformer().to(device)
|
| 35 |
|
| 36 |
acoustic_model_path = os.path.join(dirname, "../ressources/e2e_model/squeezeformer")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
model.load_state_dict(torch.load(acoustic_model_path, map_location=device))
|
| 39 |
|
|
|
|
| 8 |
from torchaudio.models.decoder import ctc_decoder
|
| 9 |
from torchaudio.transforms import Resample
|
| 10 |
from squeezeformer import MySqueezeformer
|
| 11 |
+
import torch.ao.quantization
|
| 12 |
|
| 13 |
# -------------------------
|
| 14 |
# Paths
|
|
|
|
| 34 |
model = MySqueezeformer().to(device)
|
| 35 |
|
| 36 |
acoustic_model_path = os.path.join(dirname, "../ressources/e2e_model/squeezeformer")
|
| 37 |
+
if device == "cpu":
|
| 38 |
+
model = torch.ao.quantization.quantize_dynamic(
|
| 39 |
+
model, {torch.nn.Linear}, dtype=torch.qint8
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
|
| 43 |
model.load_state_dict(torch.load(acoustic_model_path, map_location=device))
|
| 44 |
|