bug fixes

This commit is contained in:
Kristofer Söderström
2023-11-06 09:31:53 +01:00
parent f88186dacc
commit 7799d03960
2 changed files with 5 additions and 10 deletions

15
app.py
View File

@@ -5,9 +5,10 @@ from tkinter import messagebox
from src._LocalTranscribe import transcribe, get_path from src._LocalTranscribe import transcribe, get_path
import customtkinter import customtkinter
import threading import threading
from colorama import Back, Fore from colorama import Back
import colorama import colorama
colorama.init(autoreset=True) colorama.init(autoreset=True)
import os
@@ -72,7 +73,8 @@ class App:
# Helper functions # Helper functions
# Browsing # Browsing
def browse(self): def browse(self):
folder_path = filedialog.askdirectory() initial_dir = os.getcwd()
folder_path = filedialog.askdirectory(initialdir=initial_dir)
self.path_entry.delete(0, tk.END) self.path_entry.delete(0, tk.END)
self.path_entry.insert(0, folder_path) self.path_entry.insert(0, folder_path)
# Start transcription # Start transcription
@@ -92,15 +94,8 @@ class App:
self.progress_bar.start() self.progress_bar.start()
# Setting path and files # Setting path and files
glob_file = get_path(path) glob_file = get_path(path)
info_path = 'Continue?' messagebox.showinfo("Message", "Starting transcription!")
answer = messagebox.askyesno("Confirmation", info_path)
if not answer:
self.progress_bar.stop()
self.progress_bar.pack_forget()
self.transcribe_button.configure(state=tk.NORMAL)
return
# Start transcription # Start transcription
error_language = 'https://github.com/openai/whisper#available-models-and-languages'
try: try:
output_text = transcribe(path, glob_file, model, language, verbose) output_text = transcribe(path, glob_file, model, language, verbose)
except UnboundLocalError: except UnboundLocalError:

Binary file not shown.