g1ya commited on
Commit
c09b215
·
verified ·
1 Parent(s): ebffe19

Upload folder using huggingface_hub

Browse files
ressources/e2e_model/squeezeformer CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2367109bab7fb7c395af10b5e2daf17941d8690c69050912ded400ba392ce9eb
3
- size 36523741
 
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:880abff36dd3c64ad9df109773ef3d49c7909e5de80cd63350b188e13e1df42c
3
- size 6568786
 
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:88604fe3c4c653f822748386ad143ba4e3d9086577ed6d3ef205100a28d3d115
3
- size 87786060
 
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:b89ecec10ddd295bca9abfc10a91a5488ad47217efd9ef8d672f3ba0f61765a4
3
- size 1102536
 
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:0cfd6e89442fcff8a9850d69a1b23fb6b71cc8dcc98952d5c3c144038a013bc2
3
- size 239191
 
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:eae00d2ddc1baf700a3247817d6371959c71f967d9fb91529a86efea1492dfed
3
- size 315116
 
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:61709eed30b35a4a6403fb54968326d4d20731263ed1b76190146d11347eab27
3
- size 18971108
 
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