isort & black
- trying to fix environment issues
This commit is contained in:
@@ -1,9 +1,18 @@
|
||||
from transcription.device_configuration import DeviceConfiguration
|
||||
|
||||
|
||||
# TODO: implement saving & removing configuration
|
||||
def save_configuration(cfg: DeviceConfiguration):
|
||||
config = {
|
||||
"Model": cfg.model_name,
|
||||
"Batch Size": cfg.batch_size,
|
||||
"Data Type": cfg.data_type
|
||||
}
|
||||
"Data Type": cfg.data_type,
|
||||
}
|
||||
|
||||
|
||||
def load_config():
|
||||
pass
|
||||
|
||||
|
||||
def delete_config():
|
||||
pass
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
import os
|
||||
import threading
|
||||
import queue
|
||||
import threading
|
||||
import tkinter as tk
|
||||
from tkinter import scrolledtext, filedialog, messagebox
|
||||
from tkinter import filedialog, messagebox, scrolledtext
|
||||
|
||||
import customtkinter as ctk
|
||||
import torch
|
||||
|
||||
from ui.ui_log_handler import setup_ui_logger
|
||||
from transcription.torch_checker import check_torch
|
||||
from transcription.device_configuration import DeviceConfiguration
|
||||
from transcription.audio_transcription import AudioTranscription
|
||||
|
||||
from transcription.device_configuration import DeviceConfiguration
|
||||
from transcription.torch_checker import check_torch
|
||||
from ui.ui_log_handler import setup_ui_logger
|
||||
|
||||
WINDOW_WIDTH = 900
|
||||
WINDOW_HEIGHT = 650
|
||||
@@ -175,7 +174,10 @@ class TranscriberApp(ctk.CTk):
|
||||
def _browse_input(self):
|
||||
path = filedialog.askopenfilename(
|
||||
title="Select input audio file",
|
||||
filetypes=[("Audio files", "*.wav *.mp3 *.m4a *.flac"), ("All files", "*.*")]
|
||||
filetypes=[
|
||||
("Audio files", "*.wav *.mp3 *.m4a *.flac"),
|
||||
("All files", "*.*"),
|
||||
],
|
||||
)
|
||||
if path:
|
||||
self.input_file_var.set(path)
|
||||
@@ -184,7 +186,7 @@ class TranscriberApp(ctk.CTk):
|
||||
path = filedialog.asksaveasfilename(
|
||||
title="Select output file",
|
||||
defaultextension=".txt",
|
||||
filetypes=[("Text files", "*.txt"), ("All files", "*.*")]
|
||||
filetypes=[("Text files", "*.txt"), ("All files", "*.*")],
|
||||
)
|
||||
if path:
|
||||
self.output_file_var.set(path)
|
||||
@@ -242,4 +244,4 @@ class TranscriberApp(ctk.CTk):
|
||||
messagebox.showerror("Error", str(e))
|
||||
finally:
|
||||
self.start_btn.configure(state="normal")
|
||||
self.stop_btn.configure(state="disabled")
|
||||
self.stop_btn.configure(state="disabled")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import tkinter as tk
|
||||
import logging
|
||||
import tkinter as tk
|
||||
|
||||
|
||||
class UILogHandler(logging.Handler):
|
||||
def __init__(self, text_widget: tk.Text):
|
||||
@@ -11,6 +12,7 @@ class UILogHandler(logging.Handler):
|
||||
self.text_widget.insert(tk.END, log_entry + "\n")
|
||||
self.text_widget.see(tk.END)
|
||||
|
||||
|
||||
# TODO: maybe some tqdm here, not in console?
|
||||
def setup_ui_logger(text_widget: tk.Text, level=logging.INFO):
|
||||
logger = logging.getLogger("UI_LOGGER")
|
||||
@@ -21,4 +23,4 @@ def setup_ui_logger(text_widget: tk.Text, level=logging.INFO):
|
||||
handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s"))
|
||||
logger.addHandler(handler)
|
||||
|
||||
return logger
|
||||
return logger
|
||||
|
||||
Reference in New Issue
Block a user