mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-27 23:47:46 +00:00
fix: fix a bug in regular expression exception processing (#734)
* fix a bug in regular expression exception precessing * fix ci * fix
This commit is contained in:
@@ -15,6 +15,7 @@ from pathlib import Path
|
||||
from types import ModuleType
|
||||
from typing import Union
|
||||
|
||||
from rdagent.log import rdagent_logger as logger
|
||||
from rdagent.oai.llm_conf import LLM_SETTINGS
|
||||
from rdagent.utils.agent.tpl import T
|
||||
|
||||
@@ -139,9 +140,7 @@ def filter_redundant_text(stdout: str) -> str:
|
||||
if not needs_sub:
|
||||
break
|
||||
filtered_stdout = re.sub(r"\s*\n\s*", "\n", filtered_stdout)
|
||||
except re.error as e: # sometime the generated regex pattern is invalid and yield exception.
|
||||
from rdagent.log import rdagent_logger as logger
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error in filtering progress bar: due to {e}")
|
||||
return filtered_stdout
|
||||
|
||||
|
||||
Reference in New Issue
Block a user