Skip to content

Commit ff685ce

Browse files
authored
feat: modernize (#35)
* feat: modernize * feat: modernize * feat: modernize * feat: modernize
1 parent 866b71b commit ff685ce

File tree

9 files changed

+28
-84
lines changed

9 files changed

+28
-84
lines changed

.github/workflows/build_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup Python
1414
uses: actions/setup-python@v6
1515
with:
16-
python-version: 3.14
16+
python-version: "3.11"
1717
- name: Install Build Tools
1818
run: |
1919
python -m pip install build wheel

.github/workflows/dev2master.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/license_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Python
1717
uses: actions/setup-python@v6
1818
with:
19-
python-version: 3.14
19+
python-version: "3.11"
2020
- name: Install Build Tools
2121
run: |
2222
python -m pip install build wheel

.github/workflows/publish_stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Python
2727
uses: actions/setup-python@v6
2828
with:
29-
python-version: 3.14
29+
python-version: "3.11"
3030
- name: Install Build Tools
3131
run: |
3232
python -m pip install build wheel

.github/workflows/release_workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: Release Alpha and Propose Stable
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
types: [closed]
67
branches: [dev]
78

89
jobs:
910
publish_alpha:
10-
if: github.event.pull_request.merged == true
1111
uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master
1212
secrets: inherit
1313
with:
@@ -46,7 +46,7 @@ jobs:
4646
- name: Setup Python
4747
uses: actions/setup-python@v6
4848
with:
49-
python-version: 3.14
49+
python-version: "3.11"
5050
- name: Install Build Tools
5151
run: |
5252
python -m pip install build wheel
@@ -75,7 +75,7 @@ jobs:
7575
- name: Setup Python
7676
uses: actions/setup-python@v6
7777
with:
78-
python-version: '3.14'
78+
python-version: "3.11"
7979

8080
- name: Get version from setup.py
8181
id: get_version

.github/workflows/unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
max-parallel: 2
3737
matrix:
38-
python-version: [3.8, 3.9, "3.10", "3.11"]
38+
python-version: ["3.10", "3.11"]
3939
runs-on: ubuntu-latest
4040
steps:
4141
- uses: actions/checkout@v4

ovos_stt_plugin_fasterwhisper/__init__.py

Lines changed: 16 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,11 @@ class FasterWhisperSTT(STT):
125125

126126
def __init__(self, *args, **kwargs):
127127
super().__init__(*args, **kwargs)
128-
model = self.config.get("model") or "whisper-large-v3-turbo"
129-
if model == "whisper-large-v3-turbo":
130-
model = "deepdml/faster-whisper-large-v3-turbo-ct2"
131-
else:
132-
valid_model = model in FasterWhisperSTT.MODELS
133-
if not valid_model:
134-
LOG.info(f"{model} is not default model_id ({FasterWhisperSTT.MODELS}), "
135-
f"assuming huggingface repo_id or path to local model")
128+
model = self.config.get("model") or "large-v3-turbo"
129+
valid_model = model in FasterWhisperSTT.MODELS
130+
if not valid_model:
131+
LOG.info(f"{model} is not default model_id ({FasterWhisperSTT.MODELS}), "
132+
f"assuming huggingface repo_id or path to local model")
136133

137134
self.beam_size = self.config.get("beam_size", 5)
138135
self.compute_type = self.config.get("compute_type", "int8")
@@ -210,40 +207,20 @@ def execute(self, audio, language=None):
210207

211208
@classproperty
212209
def available_languages(cls) -> set:
213-
return set(FasterWhisperSTT.LANGUAGES.keys())
210+
return set(cls.LANGUAGES.keys())
214211

215212

216213
FasterWhisperSTTConfig = {
217-
lang: [
218-
{
219-
"model": "tiny",
220-
"lang": lang,
221-
"meta": {
222-
"priority": 50,
223-
"display_name": "FasterWhisper (Tiny)",
224-
"offline": True,
225-
},
226-
},
227-
{
228-
"model": "base",
229-
"lang": lang,
230-
"meta": {
231-
"priority": 55,
232-
"display_name": f"FasterWhisper (Base)",
233-
"offline": True,
234-
},
235-
},
236-
{
237-
"model": "small",
238-
"lang": lang,
239-
"meta": {
240-
"priority": 60,
241-
"display_name": f"FasterWhisper (Small)",
242-
"offline": True,
243-
},
214+
lang: [{
215+
"model": model,
216+
"lang": lang,
217+
"meta": {
218+
"priority": 50,
219+
"display_name": f"FasterWhisper ({model})",
220+
"offline": True,
244221
},
245-
]
246-
for lang, lang_name in FasterWhisperSTT.LANGUAGES.items()
222+
} for model in FasterWhisperSTT.MODELS]
223+
for lang in FasterWhisperSTT.available_languages
247224
}
248225

249226
if __name__ == "__main__":
@@ -259,7 +236,7 @@ def available_languages(cls) -> set:
259236

260237
from speech_recognition import Recognizer, AudioFile
261238

262-
jfk = "/home/miro/PycharmProjects/OVOS/STT/ovos-stt-plugin-fasterwhisper/jfk.wav"
239+
jfk = "jfk.wav"
263240
with AudioFile(jfk) as source:
264241
audio = Recognizer().record(source)
265242

requirements/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
2-
ovos-plugin-manager>=2.1.0,<2.2.0
1+
ovos-plugin-manager>=2.1.0,<3.0.0
32
SpeechRecognition>=3.8.1
43
faster-whisper>=0.10.0
54
requests

setup.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,10 @@ def required(requirements_file):
6868
classifiers=[
6969
'Development Status :: 3 - Alpha',
7070
'Intended Audience :: Developers',
71-
'Topic :: Text Processing :: Linguistic',
7271
'License :: OSI Approved :: Apache Software License',
73-
74-
'Programming Language :: Python :: 2',
75-
'Programming Language :: Python :: 2.7',
76-
'Programming Language :: Python :: 3',
77-
'Programming Language :: Python :: 3.0',
78-
'Programming Language :: Python :: 3.1',
79-
'Programming Language :: Python :: 3.2',
80-
'Programming Language :: Python :: 3.3',
81-
'Programming Language :: Python :: 3.4',
82-
'Programming Language :: Python :: 3.5',
83-
'Programming Language :: Python :: 3.6',
8472
],
85-
keywords='mycroft ovos plugin stt',
86-
entry_points={'mycroft.plugin.stt': PLUGIN_ENTRY_POINT,
87-
'mycroft.plugin.stt.config': CONFIG_ENTRY_POINT,
88-
'neon.plugin.audio': LANG_PLUGIN_ENTRY_POINT}
73+
keywords='OpenVoiceOS mycroft ovos plugin stt',
74+
entry_points={'opm.stt': PLUGIN_ENTRY_POINT,
75+
'opm.stt.config': CONFIG_ENTRY_POINT,
76+
'opm.transformer.audio': LANG_PLUGIN_ENTRY_POINT}
8977
)

0 commit comments

Comments
 (0)