Spaces:
Sleeping
Sleeping
fix: declare device as global
Browse files
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
|