ffreemt commited on
Commit
ca48eff
·
1 Parent(s): 3895ca8

Update lsb_release -a bitsandbytes device_map={'': 0} rich, check nvidia-smi with subproces.run

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py CHANGED
@@ -52,6 +52,21 @@ from transformers.generation import GenerationConfig
52
 
53
  from example_list import css, example_list
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  if not torch.cuda.is_available():
56
  raise gr.Error("torch.cuda.is_available() is False, cant continue...")
57
 
 
52
 
53
  from example_list import css, example_list
54
 
55
+ if True:
56
+ ret = sp.run("lsb_release -a", capture_output=1, check=0, shell=1, encoding='utf8')
57
+ if ret.stdout:
58
+ rich.print(ret.stdout)
59
+ if ret.stderr:
60
+ rich.print("[red bold]" + ret.stdout)
61
+
62
+ ret = sp.run("nvidia-smi", capture_output=1, check=0, shell=1, encoding='utf8')
63
+ if ret.stdout:
64
+ rich.print(ret.stdout)
65
+ if ret.stderr:
66
+ rich.print("[red bold]" + ret.stdout)
67
+ raise SystemExit("Interrupt by intentioin")
68
+
69
+
70
  if not torch.cuda.is_available():
71
  raise gr.Error("torch.cuda.is_available() is False, cant continue...")
72