Skip to content

Commit

Permalink
v2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BBC-Esq committed Oct 27, 2023
1 parent 314e8e4 commit 0ab1373
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ct2_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 4 additions & 5 deletions ct2_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
faster-whisper==0.9.0
pyaudio==0.2.13
pyperclip==1.8.2
PySide6==6.5.2
PySide6==6.5.2
PyYAML==6.0.1

0 comments on commit 0ab1373

Please sign in to comment.