From b1ae6b13070e555b707168271f93a62b41667ad0 Mon Sep 17 00:00:00 2001 From: Maxime Gasse Date: Mon, 4 Nov 2024 16:34:45 -0500 Subject: [PATCH] hide huggingface progress bar --- .../src/browsergym/visualwebarena/task.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/browsergym/visualwebarena/src/browsergym/visualwebarena/task.py b/browsergym/visualwebarena/src/browsergym/visualwebarena/task.py index b6b7f91e..61486409 100644 --- a/browsergym/visualwebarena/src/browsergym/visualwebarena/task.py +++ b/browsergym/visualwebarena/src/browsergym/visualwebarena/task.py @@ -176,6 +176,15 @@ def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]: self.config_file = f.name # build the evaluator + from transformers.utils.logging import ( + disable_progress_bar, + enable_progress_bar, + is_progress_bar_enabled, + ) + + hide_progress_bar = is_progress_bar_enabled() + if hide_progress_bar: + disable_progress_bar() captioning_fn = get_captioning_fn( device=self.eval_captioning_model_device, dtype=( @@ -185,6 +194,8 @@ def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]: ), model_name="Salesforce/blip2-flan-t5-xl", ) + if hide_progress_bar: + enable_progress_bar() self.evaluator = evaluator_router(self.config_file, captioning_fn=captioning_fn) # reset instance if needed (classifieds domain only)