Configuration option for number of concurrent requests
This commit is contained in:
1 parent
94ca8b8256
commit
f43b713590
8 files changed
+151
-16
No files matched your search
@@ -874,7 +874,7 @@ class CopienatorApp(tk.Tk):
|
||||
variant = self._current_variant()
|
||||
evaluation_arg = self._evaluation_arg()
|
||||
for spec in step.arguments:
|
||||
if step.section == REFAIRE_SECTION:
|
||||
if step.section == REFAIRE_SECTION and spec.name != "workers":
|
||||
continue
|
||||
if spec.variants and variant.id not in spec.variants:
|
||||
continue
|
||||
@@ -1318,7 +1318,11 @@ class CopienatorApp(tk.Tk):
|
||||
if self.current_step and self.current_step.section == REFAIRE_SECTION:
|
||||
if self.current_step.id == "refaire_selection" and self.refaire_panel:
|
||||
return self.refaire_panel.values()
|
||||
return {"target": self._evaluation_arg(), "annotation_dir": self.state_store.step("refaire_selection").get("values", {}).get("annotation_dir", "BGnot")}
|
||||
return {
|
||||
"target": self._evaluation_arg(),
|
||||
"annotation_dir": self.state_store.step("refaire_selection").get("values", {}).get("annotation_dir", "BGnot"),
|
||||
**{name: variable.get() for name, variable in self.arg_vars.items()},
|
||||
}
|
||||
return {name: variable.get() for name, variable in self.arg_vars.items()}
|
||||
|
||||
def _save_current_form(self) -> None:
|
||||
|
||||
@@ -74,6 +74,15 @@ def arg_target(help_text: str = "un dossier d’évaluation ou un fichier à tra
|
||||
)
|
||||
|
||||
|
||||
def arg_correction_workers(variants: tuple[str, ...] = ()) -> ArgumentSpec:
|
||||
return ArgumentSpec(
|
||||
"workers", "Requêtes simultanées", "int", "--workers", default=12,
|
||||
help="Fixe le nombre maximal de requêtes Gemini de correction simultanées (au moins 1). "
|
||||
"Réduisez cette valeur pour limiter la charge sur l’API.",
|
||||
variants=variants,
|
||||
)
|
||||
|
||||
|
||||
def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
def python(ident, label, script, **kwargs):
|
||||
supports_verbose = kwargs.pop("supports_verbose", True)
|
||||
@@ -317,6 +326,16 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
(python("default", "Détection des labels", "labels"),),
|
||||
arguments=(
|
||||
arg_target(),
|
||||
ArgumentSpec(
|
||||
"workers",
|
||||
"Requêtes simultanées",
|
||||
"int",
|
||||
"--workers",
|
||||
default=12,
|
||||
help="Fixe le nombre maximal de requêtes Gemini simultanées (au moins 1). "
|
||||
"Réduisez cette valeur pour limiter la charge sur l’API. "
|
||||
"Les pages d’une même copie sont traitées dans l’ordre.",
|
||||
),
|
||||
ArgumentSpec(
|
||||
"overwrite",
|
||||
"Régénérer les résultats",
|
||||
@@ -411,6 +430,7 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
),
|
||||
arguments=(
|
||||
arg_target("le dossier de l’évaluation ou une image Group_X.jpg"),
|
||||
arg_correction_workers(("live", "hybrid", "refaire", "integrate")),
|
||||
ArgumentSpec(
|
||||
"overwrite",
|
||||
"Écraser les corrections existantes",
|
||||
@@ -796,6 +816,8 @@ def build_refaire_workflow() -> list[StepDefinition]:
|
||||
steps = [selection]
|
||||
for suffix, title, description, program, flags, optional in definitions:
|
||||
arguments = (arg_target(),) if program else ()
|
||||
if suffix == "correct":
|
||||
arguments += (arg_correction_workers(),)
|
||||
if suffix == "merge":
|
||||
arguments += (ArgumentSpec(
|
||||
"annotation_dir",
|
||||
|
||||
Reference in new issue
Block a user