diff options
| author | yum <yum.food.vr@gmail.com> | 2023-09-03 19:29:44 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-09-03 19:29:44 -0700 |
| commit | 6020bc056d8992523ae62feb4edfbae10b169880 (patch) | |
| tree | 06d970506dc28c68c26f713f29d7e687c6593efc /GUI | |
| parent | ae5db8b21e7db2ab9941cca47a5d57352d3bb1fa (diff) | |
Wire transcribe_v2.py into GUI
Also:
* Enable SO_REUSEADDR on browser src socket
* Temporarily add evaluation dependencies to requirements.txt
* Fix browser src. It's now looking for a prefix that the python app
actually uses.
Diffstat (limited to 'GUI')
| -rw-r--r-- | GUI/GUI/GUI/Frame.cpp | 2 | ||||
| -rw-r--r-- | GUI/GUI/GUI/PythonWrapper.cpp | 2 | ||||
| -rw-r--r-- | GUI/GUI/GUI/WebServer.cpp | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/GUI/GUI/GUI/Frame.cpp b/GUI/GUI/GUI/Frame.cpp index a4c186b..9a781e8 100644 --- a/GUI/GUI/GUI/Frame.cpp +++ b/GUI/GUI/GUI/Frame.cpp @@ -2295,7 +2295,7 @@ void Frame::OnAppStart(wxCommandEvent& event) { transcript_.SetFinalized(false);
}
- std::regex pattern("^Transcription \\(([0-9]*\\.[0-9]+) seconds\\):");
+ std::regex pattern("^Transcript: ");
if (std::regex_search(out_line, pattern)) {
std::string filtered_transcript = std::regex_replace(out_line, pattern, "");
filtered_transcript.erase(std::remove_if(filtered_transcript.begin(), filtered_transcript.end(), [](char c) {
diff --git a/GUI/GUI/GUI/PythonWrapper.cpp b/GUI/GUI/GUI/PythonWrapper.cpp index d98a5d4..7141037 100644 --- a/GUI/GUI/GUI/PythonWrapper.cpp +++ b/GUI/GUI/GUI/PythonWrapper.cpp @@ -480,7 +480,7 @@ std::future<bool> PythonWrapper::StartApp( return InvokeWithArgs({ "-u", // Unbuffered output - "Resources/Scripts/transcribe.py", + "Resources/Scripts/transcribe_v2.py", "--config", config_path, }, std::move(out_cb), diff --git a/GUI/GUI/GUI/WebServer.cpp b/GUI/GUI/GUI/WebServer.cpp index ba7eecd..2b589c6 100644 --- a/GUI/GUI/GUI/WebServer.cpp +++ b/GUI/GUI/GUI/WebServer.cpp @@ -70,6 +70,12 @@ namespace WebServer { return false;
}
+ int optval = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&optval, sizeof(optval)) == SOCKET_ERROR) {
+ Log(out_, "Failed to setsockopt(SO_REUSEADDR): {}", WSAGetLastError());
+ return 1;
+ }
+
u_long enable_nonblock = 1;
if (ioctlsocket(sock, FIONBIO, &enable_nonblock) == SOCKET_ERROR) {
Log(out_, "Failed to enable non-blocking socket: {}\n", WSAGetLastError());
|
