musictimer commited on
Commit
d294854
·
1 Parent(s): bd14b61

Fix initial bugs

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -308,7 +308,12 @@ class WebGameEngine:
308
  logger.info("WebPlayEnv set to human control mode (fallback)")
309
 
310
  # Enable torch.compile by default like play.py does (can disable with DISABLE_TORCH_COMPILE=1)
311
- import os
 
 
 
 
 
312
  os.environ["DISABLE_TORCH_COMPILE"] = "0"
313
  if device.type == "cuda" and os.getenv("DISABLE_TORCH_COMPILE", "0") != "1":
314
  logger.info("Compiling models for faster inference (like play.py --compile)...")
 
308
  logger.info("WebPlayEnv set to human control mode (fallback)")
309
 
310
  # Enable torch.compile by default like play.py does (can disable with DISABLE_TORCH_COMPILE=1)
311
+ import os, pwd
312
+ try:
313
+ pwd.getpwuid(os.getuid())
314
+ except KeyError:
315
+ os.environ["USER"] = "huggingface"
316
+
317
  os.environ["DISABLE_TORCH_COMPILE"] = "0"
318
  if device.type == "cuda" and os.getenv("DISABLE_TORCH_COMPILE", "0") != "1":
319
  logger.info("Compiling models for faster inference (like play.py --compile)...")