Skip to content

Commit 585c5f2

Browse files
authored
Merge pull request #246 from FrancescoCaracciolo/canvas
Add initial tab support (Canvas)
2 parents d097ed1 + 64d5267 commit 585c5f2

File tree

11 files changed

+1546
-296
lines changed

11 files changed

+1546
-296
lines changed

src/controller.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
from dataclasses import dataclass
21
from typing import Any
32
from gi.repository import GLib, Gio
43
import os
54
import base64
6-
from gi.repository.GObject import new
75

86
from .utility.media import get_image_base64, get_image_path
97

@@ -16,7 +14,6 @@
1614
from .handlers.embeddings import EmbeddingHandler
1715
from .handlers.websearch import WebSearchHandler
1816

19-
import time
2017
from .utility.system import is_flatpak
2118
from .utility.pip import install_module
2219
from .utility.profile_settings import get_settings_dict_by_groups

src/handlers/stt/whispercpp_handler.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from ...utility.strings import quote_string
12
from ...utility.system import get_spawn_command
23
from .stt import STTHandler
34
from ...handlers import ErrorSeverity, ExtraSettings
@@ -43,7 +44,12 @@ def get_extra_settings(self) -> list:
4344
"default": "tiny",
4445
"website": "https://github.com/openai/whisper/blob/main/model-card.md#model-details",
4546
},
46-
ExtraSettings.NestedSetting("model_library", "Model Library", "Manage Whisper models", self.get_model_library()),
47+
ExtraSettings.EntrySetting("language", _("Language"), _("Language of the recognition."), "auto"),
48+
ExtraSettings.NestedSetting("model_library", _("Model Library"), _("Manage Whisper models"), self.get_model_library()),
49+
ExtraSettings.NestedSetting("advanced_settings", _("Advanced Settings"), _("More advanced settings"), [
50+
ExtraSettings.ScaleSetting("temperature", _("Temperature"), _("Temperature to use"), 0.0, 0.0, 1.0, 2),
51+
ExtraSettings.MultilineEntrySetting("prompt", _("Prompt for the recognition"), _("Prompt to use for the recognition"), "")
52+
])
4753
]
4854

4955
def get_model_library(self):
@@ -101,7 +107,7 @@ def recognize_file(self, path):
101107
recpath = path
102108
path = os.path.join(self.path, "whisper")
103109
exec_path = os.path.join(path, "whisper.cpp/build/bin/whisper-cli")
104-
recognize_script = exec_path + " -f " + recpath + " -m " + os.path.join(self.path, "whisper", "whisper.cpp/models/ggml-" + self.get_setting("model") + ".bin" + " --no-prints -nt")
110+
recognize_script = exec_path + " -f " + recpath + " -m " + os.path.join(self.path, "whisper", "whisper.cpp/models/ggml-" + self.get_setting("model") + ".bin" + " --no-prints -nt -l " + self.get_setting("language") + " -tp " + str(self.get_setting("temperature")) + "--prompt" + quote_string(self.get_setting("prompt")) )
105111
try:
106112
out = subprocess.check_output(get_spawn_command() + ["bash", "-c", recognize_script])
107113
print(out)

src/meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ ui_sources = [
5555
'ui/screenrecorder.py',
5656
'ui/shortcuts.py',
5757
'ui/mini_window.py',
58+
'ui/explorer.py',
5859
]
5960

6061
widgets_sources = [
@@ -73,6 +74,8 @@ widgets_sources = [
7374
'ui/widgets/thinking.py',
7475
'ui/widgets/documents_reader.py',
7576
'ui/widgets/tipscarousel.py',
77+
'ui/widgets/browser.py',
78+
'ui/widgets/code_editor.py',
7679
]
7780

7881
handler_sources = [

0 commit comments

Comments
 (0)