From 0ab137342c5e6875080584ac091c4f8af68de09c Mon Sep 17 00:00:00 2001 From: BBC-Esq Date: Fri, 27 Oct 2023 12:39:23 -0400 Subject: [PATCH] v2.1 --- ct2_gui.py | 2 +- ct2_logic.py | 9 ++++----- requirements.txt | 3 ++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ct2_gui.py b/ct2_gui.py index 8ce81b5..2e16146 100644 --- a/ct2_gui.py +++ b/ct2_gui.py @@ -4,7 +4,7 @@ import yaml class MyWindow(QWidget): - def __init__(self, cuda_available=False): # Add cuda_available parameter + def __init__(self, cuda_available=False): super().__init__() layout = QVBoxLayout(self) diff --git a/ct2_logic.py b/ct2_logic.py index b46326d..0af87be 100644 --- a/ct2_logic.py +++ b/ct2_logic.py @@ -18,17 +18,16 @@ def load_settings(self): try: with open("config.yaml", "r") as f: config = yaml.safe_load(f) - # Check if essential entries are missing and recreate them if necessary if "device_type" not in config: - config["device_type"] = "cpu" # You can set the default device type here + config["device_type"] = "cpu" if "model_name" not in config: - config["model_name"] = "base.en" # You can set the default model name here + config["model_name"] = "base.en" if "quantization_type" not in config: - config["quantization_type"] = "int8" # You can set the default quantization type here + config["quantization_type"] = "int8" self.update_model(config["model_name"], config["quantization_type"], config["device_type"]) except FileNotFoundError: - self.update_model("base.en", "int8", "cpu") # Set default values if config file doesn't exist + self.update_model("base.en", "int8", "cpu") def save_settings(self, model_name, quantization_type, device_type): try: diff --git a/requirements.txt b/requirements.txt index 886161b..7b2395a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ faster-whisper==0.9.0 pyaudio==0.2.13 pyperclip==1.8.2 -PySide6==6.5.2 \ No newline at end of file +PySide6==6.5.2 +PyYAML==6.0.1 \ No newline at end of file