menouaw commited on
Commit
0f660eb
·
1 Parent(s): 107835f

add: redirection des journaux

Browse files
Files changed (1) hide show
  1. webui.py +8 -3
webui.py CHANGED
@@ -40,13 +40,18 @@ def _ensure_playwright():
40
  # cheap when the browser is already present.
41
  try:
42
  subprocess.run(
43
- [sys.executable, "-m", "playwright", "install", "--with-deps", "chromium"],
44
  check=True,
45
- stdout=subprocess.DEVNULL,
46
  stderr=subprocess.STDOUT,
47
  )
48
  except Exception as err: # pylint: disable=broad-except
49
- logging.warning("Playwright browser installation failed (continuing without it): %s", err)
 
 
 
 
 
50
 
51
 
52
  # ---------------------------------------------------------------------------
 
40
  # cheap when the browser is already present.
41
  try:
42
  subprocess.run(
43
+ ["playwright", "install", "--with-deps", "chromium"],
44
  check=True,
45
+ stdout=subprocess.PIPE,
46
  stderr=subprocess.STDOUT,
47
  )
48
  except Exception as err: # pylint: disable=broad-except
49
+ logging.warning("Playwright install with deps failed: %s", err)
50
+ # Fallback: try without system deps (may succeed in HF image)
51
+ try:
52
+ subprocess.run(["playwright", "install", "chromium"], check=True)
53
+ except Exception as err2: # pylint: disable=broad-except
54
+ logging.error("Playwright browser installation ultimately failed: %s", err2)
55
 
56
 
57
  # ---------------------------------------------------------------------------