JasonYinnnn commited on
Commit
b349190
·
1 Parent(s): b843700

check bucket

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -22,6 +22,24 @@ os.environ["TORCH_EXTENSIONS_DIR"] = "/cache_data/.cache/torch_extensions"
22
 
23
  os.environ["TMPDIR"] = "/cache_data/bucket/tmp"
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  os.makedirs(os.environ["HF_HOME"], exist_ok=True)
26
  os.makedirs(os.environ["HF_HUB_CACHE"], exist_ok=True)
27
  os.makedirs(os.environ["HF_DATASETS_CACHE"], exist_ok=True)
 
22
 
23
  os.environ["TMPDIR"] = "/cache_data/bucket/tmp"
24
 
25
+
26
+ path = "/cache_data"
27
+ print("exists:", os.path.exists(path), flush=True)
28
+ print("isdir:", os.path.isdir(path), flush=True)
29
+
30
+ try:
31
+ print("listdir:", os.listdir(path)[:10], flush=True)
32
+ except Exception as e:
33
+ print("listdir failed:", repr(e), flush=True)
34
+
35
+ try:
36
+ test_file = os.path.join(path, "_write_test.txt")
37
+ with open(test_file, "w") as f:
38
+ f.write("ok")
39
+ print("write test ok:", test_file, flush=True)
40
+ except Exception as e:
41
+ print("write test failed:", repr(e), flush=True)
42
+
43
  os.makedirs(os.environ["HF_HOME"], exist_ok=True)
44
  os.makedirs(os.environ["HF_HUB_CACHE"], exist_ok=True)
45
  os.makedirs(os.environ["HF_DATASETS_CACHE"], exist_ok=True)