-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from NavodPeiris/dev
add flexible dependency versioning
- Loading branch information
Showing
8 changed files
with
42 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,9 @@ Transcriptor method takes 7 arguments. | |
|
||
4. model size ("tiny", "small", "medium", "large", "large-v1", "large-v2", "large-v3") | ||
|
||
5. ACCESS_TOKEN: huggingface acccess token (also get permission to access `pyannote/[email protected]`) | ||
5. ACCESS_TOKEN: huggingface acccess token | ||
1. Permission to access `pyannote/[email protected]` and `pyannote/segmentation` | ||
2. Token requires permission for 'Read access to contents of all public gated repos you can access' | ||
|
||
6. voices_folder (contains speaker voice samples for speaker recognition) | ||
|
||
|
@@ -86,13 +88,16 @@ transcript will also indicate the timeframe in seconds where each speaker speaks | |
### Transcription example: | ||
|
||
``` | ||
import os | ||
from speechlib import Transcriptor | ||
file = "obama_zach.wav" # your audio file | ||
voices_folder = "" # voices folder containing voice samples for recognition | ||
language = "en" # language code | ||
log_folder = "logs" # log folder for storing transcripts | ||
modelSize = "tiny" # size of model to be used [tiny, small, medium, large-v1, large-v2, large-v3] | ||
quantization = False # setting this 'True' may speed up the process but lower the accuracy | ||
ACCESS_TOKEN = "your hf key" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "huggingface api key" # get permission to access pyannote/[email protected] on huggingface | ||
# quantization only works on faster-whisper | ||
transcriptor = Transcriptor(file, log_folder, language, modelSize, ACCESS_TOKEN, voices_folder, quantization) | ||
|
@@ -110,7 +115,7 @@ res = transcriptor.custom_whisper("D:/whisper_tiny_model/tiny.pt") | |
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your api key") | ||
res = transcriptor.assemby_ai_model("assemblyAI api key") | ||
res --> [["start", "end", "text", "speaker"], ["start", "end", "text", "speaker"]...] | ||
``` | ||
|
@@ -211,4 +216,4 @@ This library uses following huggingface models: | |
|
||
#### https://huggingface.co/speechbrain/spkrec-ecapa-voxceleb | ||
#### https://huggingface.co/Ransaka/whisper-tiny-sinhala-20k-8k-steps-v2 | ||
#### https://huggingface.co/pyannote/speaker-diarization | ||
#### https://huggingface.co/pyannote/speaker-diarization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ greek_convo_short.mp3 | |
greek_convo_short.wav | ||
my_test.py | ||
greek_convo.mp3 | ||
greek_convo.wav | ||
greek_convo.wav | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import os | ||
from speechlib import Transcriptor | ||
|
||
file = "obama_zach.wav" # your audio file | ||
|
@@ -6,7 +7,7 @@ | |
log_folder = "logs" # log folder for storing transcripts | ||
modelSize = "tiny" # size of model to be used [tiny, small, medium, large-v1, large-v2, large-v3] | ||
quantization = False # setting this 'True' may speed up the process but lower the accuracy | ||
ACCESS_TOKEN = "your hf key" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "huggingface api key" # get permission to access pyannote/[email protected] on huggingface | ||
|
||
# quantization only works on faster-whisper | ||
transcriptor = Transcriptor(file, log_folder, language, modelSize, ACCESS_TOKEN, voices_folder, quantization) | ||
|
@@ -24,4 +25,4 @@ | |
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
|
||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your api key") | ||
res = transcriptor.assemby_ai_model("assemblyAI api key") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,13 +70,16 @@ transcript will also indicate the timeframe in seconds where each speaker speaks | |
### Transcription example: | ||
|
||
``` | ||
import os | ||
from speechlib import Transcriptor | ||
file = "obama_zach.wav" # your audio file | ||
voices_folder = "" # voices folder containing voice samples for recognition | ||
language = "en" # language code | ||
log_folder = "logs" # log folder for storing transcripts | ||
modelSize = "tiny" # size of model to be used [tiny, small, medium, large-v1, large-v2, large-v3] | ||
quantization = False # setting this 'True' may speed up the process but lower the accuracy | ||
ACCESS_TOKEN = "your hf key" # get permission to access pyannote/[email protected] on huggingface | ||
ACCESS_TOKEN = "huggingface api key" # get permission to access pyannote/[email protected] on huggingface | ||
# quantization only works on faster-whisper | ||
transcriptor = Transcriptor(file, log_folder, language, modelSize, ACCESS_TOKEN, voices_folder, quantization) | ||
|
@@ -94,7 +97,9 @@ res = transcriptor.custom_whisper("D:/whisper_tiny_model/tiny.pt") | |
res = transcriptor.huggingface_model("Jingmiao/whisper-small-chinese_base") | ||
# use assembly ai model | ||
res = transcriptor.assemby_ai_model("your api key") | ||
res = transcriptor.assemby_ai_model("assemblyAI api key") | ||
res --> [["start", "end", "text", "speaker"], ["start", "end", "text", "speaker"]...] | ||
``` | ||
|
||
#### if you don't want speaker names: keep voices_folder as an empty string "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
transformers==4.36.2 | ||
torch==2.1.2 | ||
torchaudio==2.1.2 | ||
pydub==0.25.1 | ||
pyannote.audio==3.1.1 | ||
speechbrain==0.5.16 | ||
accelerate==0.26.1 | ||
faster-whisper==0.10.1 | ||
openai-whisper==20231117 | ||
transformers>=4.36.2, <5.0.0 | ||
torch>=2.1.2, <3.0.0 | ||
torchaudio>=2.1.2, <3.0.0 | ||
pydub>=0.25.1, <1.0.0 | ||
pyannote.audio>=3.1.1, <4.0.0 | ||
speechbrain>=0.5.16, <1.0.0 | ||
accelerate>=0.26.1, <1.0.0 | ||
faster-whisper>=0.10.1, <1.0.0 | ||
openai-whisper>=20231117, <20240927 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters