From 06de3ed0cc79bd2449bce8cedf18240506a7d3bc Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Dec 2024 12:27:19 +0000 Subject: [PATCH 1/4] fix-set-num-threads to use new interface from scraibe --- scraibe_webui/utils/background.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scraibe_webui/utils/background.py b/scraibe_webui/utils/background.py index aeed223..5dc757f 100644 --- a/scraibe_webui/utils/background.py +++ b/scraibe_webui/utils/background.py @@ -5,7 +5,8 @@ from os.path import join, split from threading import Thread, BoundedSemaphore, active_count -from torch import set_num_threads +from scraibe.misc import set_threads + from scraibe_webui.global_var import MAX_CONCURRENT_MODELS import scraibe_webui.global_var as gv from .mail import MailService @@ -63,8 +64,8 @@ def parrallel_task(self, """ Background task that runs in a separate thread """ - if self.threads_per_model != 0: - set_num_threads(self.threads_per_model) + if self.threads_per_model is not None: + set_threads(yaml_threads = self.threads_per_model) # List to store temporary files temp_files = [] @@ -156,8 +157,8 @@ def parrallel_task(self, temp_file.write(result) temp_files.append(temp_file_path_json) - - MailService.from_config(self.mail_service_params).send_transcript(receiver_email=reciever, transcript_path = temp_files, **success_format_option) + + MailService.from_config(self.mail_service_params).send_transcript(receiver_email=reciever, transcript_paths = temp_files, **success_format_option) except Exception as exeption: From f8f1bb2858e59f42af23b21ce3953149c43dc4c6 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Dec 2024 12:28:48 +0000 Subject: [PATCH 2/4] Files where not attached due to typo --- scraibe_webui/utils/mail.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scraibe_webui/utils/mail.py b/scraibe_webui/utils/mail.py index 1012757..975d1d6 100644 --- a/scraibe_webui/utils/mail.py +++ b/scraibe_webui/utils/mail.py @@ -217,7 +217,6 @@ def send_transcript(self, receiver_email: str, transcript_paths: Union[str, list transcript_paths = [] elif isinstance(transcript_paths, str): transcript_paths = [transcript_paths] - _message = (self.success_template or "Your transcript is ready.").format( css_path=self.css_template_path, **format_options ) From ab7bc99b1c0fe4ea6993ce53452100f1914dc334 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Dec 2024 12:41:32 +0000 Subject: [PATCH 3/4] added fetch depht for test job --- .github/workflows/pypi.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 2bd8a5c..b518d72 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -46,6 +46,8 @@ jobs: python-version: [3.11, 3.12] steps: - uses: actions/checkout@v4 + with: + fetch-depth: '0' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: From a0d492078647bac7f5929130d1ea8c1c96dd1792 Mon Sep 17 00:00:00 2001 From: "Schmieder, Jacob" Date: Mon, 2 Dec 2024 12:52:11 +0000 Subject: [PATCH 4/4] When installing from main now, the commit is not used for installation --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4138f2e..9d66e05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ strict = true format-jinja = """ {%- if distance == 0 -%} {{ serialize_pep440(base) }} - {%- elif branch == 'develop' -%} + {%- elif branch == 'develop' or branch == 'main' -%} {{ serialize_pep440(bump_version(base), dev = distance) }} {%- else -%} {{ serialize_pep440(bump_version(base), dev=distance, metadata=[commit]) }}