Cleaning up globals
This commit is contained in:
15
subgen.py
15
subgen.py
@@ -37,17 +37,6 @@ def convert_to_bool(in_bool):
|
|||||||
# Convert the input to string and lower case, then check against true values
|
# Convert the input to string and lower case, then check against true values
|
||||||
return str(in_bool).lower() in ('true', 'on', '1', 'y', 'yes')
|
return str(in_bool).lower() in ('true', 'on', '1', 'y', 'yes')
|
||||||
|
|
||||||
def update_env_variables():
|
|
||||||
global plextoken, plexserver, jellyfintoken, jellyfinserver, whisper_model, whisper_threads
|
|
||||||
global concurrent_transcriptions, transcribe_device, procaddedmedia, procmediaonplay
|
|
||||||
global namesublang, skipifinternalsublang, webhookport, word_level_highlight, debug
|
|
||||||
global use_path_mapping, path_mapping_from, path_mapping_to, model_location, monitor
|
|
||||||
global transcribe_folders, transcribe_or_translate, force_detected_language_to
|
|
||||||
global clear_vram_on_complete, compute_type, append, reload_script_on_change
|
|
||||||
global model_prompt, custom_model_prompt, lrc_for_audio_files, custom_regroup
|
|
||||||
global subextension, subextensionSDH, detect_language_length, skipifexternalsub
|
|
||||||
global kwargs
|
|
||||||
|
|
||||||
plextoken = os.getenv('PLEXTOKEN', 'token here')
|
plextoken = os.getenv('PLEXTOKEN', 'token here')
|
||||||
plexserver = os.getenv('PLEXSERVER', 'http://192.168.1.111:32400')
|
plexserver = os.getenv('PLEXSERVER', 'http://192.168.1.111:32400')
|
||||||
jellyfintoken = os.getenv('JELLYFINTOKEN', 'token here')
|
jellyfintoken = os.getenv('JELLYFINTOKEN', 'token here')
|
||||||
@@ -93,8 +82,6 @@ def update_env_variables():
|
|||||||
subextension = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.srt"
|
subextension = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.srt"
|
||||||
subextensionSDH = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.sdh.srt"
|
subextensionSDH = f".subgen.{whisper_model.split('.')[0]}.{namesublang}.sdh.srt"
|
||||||
|
|
||||||
update_env_variables()
|
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
model = None
|
model = None
|
||||||
|
|
||||||
@@ -103,7 +90,7 @@ docker_status = "Docker" if in_docker else "Standalone"
|
|||||||
last_print_time = None
|
last_print_time = None
|
||||||
|
|
||||||
#start queue
|
#start queue
|
||||||
global task_queue
|
task_queue
|
||||||
task_queue = queue.Queue()
|
task_queue = queue.Queue()
|
||||||
|
|
||||||
def transcription_worker():
|
def transcription_worker():
|
||||||
|
|||||||
Reference in New Issue
Block a user