apehex commited on
Commit
063db06
·
1 Parent(s): 75aa452

Use the latest APIs + fix dep conflicts

Browse files
Files changed (3) hide show
  1. README.md +1 -2
  2. app.py +6 -3
  3. requirements.txt +4 -4
README.md CHANGED
@@ -5,9 +5,8 @@ emoji: '📊'
5
  colorFrom: 'red'
6
  colorTo: 'gray'
7
  sdk: 'gradio'
8
- sdk_version: '6.2.0'
9
  app_file: 'app.py'
10
- app_build_command: 'pip install -r requirements.txt'
11
  license: 'agpl-3.0'
12
  short_description: 'Display the influence of each token on the prediction.'
13
  models: ['openai/gpt-oss-20b']
 
5
  colorFrom: 'red'
6
  colorTo: 'gray'
7
  sdk: 'gradio'
8
+ sdk_version: '6.4.0'
9
  app_file: 'app.py'
 
10
  license: 'agpl-3.0'
11
  short_description: 'Display the influence of each token on the prediction.'
12
  models: ['openai/gpt-oss-20b']
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import gradio
2
  import spaces
3
- import torch.cuda
4
 
5
  import psaiops.common.model
6
  import psaiops.common.tokenizer
@@ -12,8 +11,12 @@ import psaiops.score.residual.app as app
12
  psaiops.common.model.get_model(name=app.MODEL, device='cpu')
13
 
14
  # but do not instantiate unless necessary
15
- _MODELS = {'cpu': None, 'cuda': None,}
16
- _TOKENIZERS = {'cpu': None, 'cuda': None,}
 
 
 
 
17
 
18
  # LAZY #########################################################################
19
 
 
1
  import gradio
2
  import spaces
 
3
 
4
  import psaiops.common.model
5
  import psaiops.common.tokenizer
 
11
  psaiops.common.model.get_model(name=app.MODEL, device='cpu')
12
 
13
  # but do not instantiate unless necessary
14
+ _MODELS = {
15
+ 'cpu': None,
16
+ 'cuda': None,}
17
+ _TOKENIZERS = {
18
+ 'cpu': psaiops.common.tokenizer.get_tokenizer(name=app.MODEL, device='cpu'),
19
+ 'cuda': psaiops.common.tokenizer.get_tokenizer(name=app.MODEL, device='cuda'),}
20
 
21
  # LAZY #########################################################################
22
 
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
- accelerate>=1.10
2
  deformers>=0.0
3
  gradio>=6.0
4
- kernels>=0.10
5
- psaiops>=0.5
6
- spaces>=0.44
7
  triton==3.4
 
1
+ accelerate>=1.12
2
  deformers>=0.0
3
  gradio>=6.0
4
+ kernels>=0.11
5
+ psaiops>=0.6
6
+ spaces>=0.47
7
  triton==3.4