rrg92 commited on
Commit
29eda7d
0 Parent(s):
Files changed (7) hide show
  1. .gitattributes +39 -0
  2. Dockerfile +7 -0
  3. README.md +11 -0
  4. Sample.mp3 +3 -0
  5. SampleSmall.wav +3 -0
  6. Test.ps1 +50 -0
  7. docker-compose.yml +16 -0
.gitattributes ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz 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
+ *.wav filter=lfs diff=lfs merge=lfs -text
37
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
38
+ Sample.mp3 filter=lfs diff=lfs merge=lfs -text
39
+ SampleSmall.wav filter=lfs diff=lfs merge=lfs -text
Dockerfile ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ FROM fedirz/faster-whisper-server:latest-cuda
2
+
3
+
4
+ RUN pip install ffmpeg-python
5
+
6
+ RUN mkdir -p /data/hugging-face
7
+ ENV HF_HOME /data/hugging-face
README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Fastwhisper
3
+ emoji: 🦀
4
+ colorFrom: yellow
5
+ colorTo: red
6
+ sdk: docker
7
+ pinned: false
8
+ app_port: 8000
9
+ ---
10
+
11
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Sample.mp3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:42592316b61129cf09cac2ce38396883539ce31815eafc166e5f08b71b6dbf06
3
+ size 5047397
SampleSmall.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2e4948c16d38a8883f961c70aeadba90ef2da755db0577e868ce61095be21de
3
+ size 180268
Test.ps1 ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ $ErrorActionPreference = "Stop";
2
+
3
+ # Send the POST request with the form data
4
+ $Uri = "http://localhost:8080/v1/audio/transcriptions"
5
+
6
+ function MultiPart($data){
7
+ $FormBoundary = [System.Guid]::NewGuid().ToString();
8
+ $BodyLines = @()
9
+
10
+ $Fields = @($data.keys)
11
+
12
+ foreach($FieldName in $Fields){
13
+ $FieldValue = $data[$FieldName];
14
+ $BodyLines += "--$FormBoundary"
15
+
16
+ if($FieldValue -is [IO.FileInfo]){
17
+
18
+ $File = $FieldValue
19
+ $BodyLines += "Content-Disposition: form-data; name=`"$FieldName`"; filename=`"$($File.name)`""
20
+ $BodyLines += "Content-Type: application/octet-stream"
21
+ $FileBytes = [System.IO.File]::ReadAllBytes($File.FullName);
22
+ $FieldValue = [System.Text.Encoding]::GetEncoding("iso-8859-1").GetString($FileBytes)
23
+ } else {
24
+ $BodyLines += "Content-Disposition: form-data; name=`"$FieldName`""
25
+ }
26
+
27
+ $BodyLines += ""
28
+ $BodyLines += $FieldValue
29
+ }
30
+
31
+
32
+ $BodyLines += "--$FormBoundary--"
33
+
34
+ $BodyFinal = $BodyLines -Join "`r`n"
35
+
36
+ Invoke-WebRequest @Args -method POST -body $BodyFinal -ContentType "multipart/form-data; boundary=$FormBoundary"
37
+ }
38
+
39
+ # Create the form data payload
40
+ $FormData = @{
41
+ "file" = (Get-Item .\SampleSmall.wav)
42
+ model = "Systran/faster-whisper-small"
43
+ }
44
+
45
+
46
+ $RawResp = MultiPart $FormData -Uri $Uri
47
+ $result = [System.Text.Encoding]::UTF8.GetString($RawResp.RawContentStream.ToArray())
48
+
49
+ # Output the response from the server
50
+ $result
docker-compose.yml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ volumes:
2
+ hfcache:
3
+
4
+ services:
5
+ wserver:
6
+ build: .
7
+ volumes:
8
+ - hfcache:/data/hugging-face
9
+ restart: unless-stopped
10
+ ports:
11
+ - 8080:8000
12
+ deploy:
13
+ resources:
14
+ reservations:
15
+ devices:
16
+ - capabilities: ["gpu"]