-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
94 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from typing import Text, Union, Dict, Iterable | ||
from pathlib import Path | ||
from pydantic import BaseModel, model_validator | ||
|
||
# Base model for configuration file | ||
class ConfigStructure(BaseModel): | ||
working_dir: Union[Text,Path] | ||
output_dir: Union[Text,Path] | ||
clean_audio_dir: Union[Text,Path] = None | ||
model: Union[Text,None] = 'large-v2' | ||
devices: Union[Text, Iterable, None] = 'cpu' | ||
logs_to_db: bool | ||
logs_db_path: Union[Text,Path,None] | ||
class Config: | ||
extra = 'forbid' | ||
validate_assigment = True | ||
|
||
@model_validator(mode= 'before') | ||
@classmethod | ||
def set_null_feilds(cls, field_values): | ||
if field_values['devices'] is None: | ||
field_values['devices'] = ['cpu'] | ||
if field_values['model'] is None: | ||
field_values['model'] = 'tiny' | ||
return field_values |
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
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
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,5 +1,20 @@ | ||
#YAML | ||
# [directories settings] | ||
working_dir: /media/ivan/Диск/WAV2VEC_WD | ||
output_dir: /media/ivan/Диск/WAV2VEC_OUTPUT | ||
|
||
# [transcriber settings] | ||
model: #large-v2 # 'tiny' by default if blank (Whisper model settings) | ||
|
||
# [multiple GPU support] | ||
devices: | ||
- cpu | ||
# set your cuda devices: #- cuda:0 | ||
#- cuda:1 | ||
# OR | ||
#set blank if CPU (set same device multiple times to spawn more workers: #- cpu | ||
#- cpu) | ||
|
||
# [logging settings] | ||
logs_to_db: True # False | ||
logs_db_path: /media/ivan/Диск/WAV2VEC_DB # set path where to store SQLite DB if logs_to_db = True| else None |
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