khang119966 commited on
Commit
6968b05
·
verified ·
1 Parent(s): b635797

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -31
app.py CHANGED
@@ -37,42 +37,12 @@ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENT
37
 
38
  env = {'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}
39
 
40
- subprocess.run('snap install chromium', env=env, shell=True)
41
- subprocess.run('wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb', env=env, shell=True)
42
- subprocess.run('DEBIAN_FRONTEND=noninteractive dpkg -i google-chrome-stable_current_amd64.deb || apt-get -y -f install', env=env, shell=True)
43
  subprocess.run('apt-get update -y', env=env, shell=True)
44
  subprocess.run('apt-get install -y wkhtmltopdf', env=env, shell=True)
45
  subprocess.run('apt-get install -y xvfb', env=env, shell=True)
46
 
47
 
48
-
49
- import imgkit
50
-
51
- imgkit.from_string("""
52
- <html>
53
- <head>
54
- <meta charset="utf-8">
55
- </head>
56
- <body>
57
- <table border="1" cellspacing="0" cellpadding="8" style="font-family:'Noto Sans'; font-size:12px; border-collapse: collapse;">
58
- <tr>
59
- <th colspan="4" style="text-align:center; font-size:14px; padding:10px;">
60
- Top hidden tokens per layer for the Prediction
61
- </th>
62
- </tr>
63
- <tr>
64
- <th>Layer ⬆️</th>
65
- <th>Top 1</th>
66
- <th>Top 2</th>
67
- <th>Top 3</th>
68
- </tr>
69
- </table>
70
- </body>
71
- </html>
72
- """, 'out.jpg')
73
-
74
- print(Image.open('out.jpg'))
75
-
76
  torch.set_default_device('cuda')
77
 
78
 
 
37
 
38
  env = {'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}
39
 
40
+ subprocess.run('apt-get install -y fonts-noto-cjk', env=env, shell=True)
 
 
41
  subprocess.run('apt-get update -y', env=env, shell=True)
42
  subprocess.run('apt-get install -y wkhtmltopdf', env=env, shell=True)
43
  subprocess.run('apt-get install -y xvfb', env=env, shell=True)
44
 
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  torch.set_default_device('cuda')
47
 
48