ivelin commited on
Commit
e21c6cb
·
1 Parent(s): 2399c69

fix: declare device as global

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,11 +7,11 @@ import html
7
  from transformers import DonutProcessor, VisionEncoderDecoderModel
8
 
9
 
10
- global model, processor
11
 
12
 
13
  def load_model(pretrained_revision: str = 'main'):
14
- global model, processor
15
  pretrained_repo_name = 'ivelin/donut-refexp-click'
16
  # revision can be git commit hash, branch or tag
17
  # use 'main' for latest revision
 
7
  from transformers import DonutProcessor, VisionEncoderDecoderModel
8
 
9
 
10
+ global model, processor, device
11
 
12
 
13
  def load_model(pretrained_revision: str = 'main'):
14
+ global model, processor, device
15
  pretrained_repo_name = 'ivelin/donut-refexp-click'
16
  # revision can be git commit hash, branch or tag
17
  # use 'main' for latest revision