Spaces:
Sleeping
Sleeping
Update pix2struct/inference.py
Browse files- pix2struct/inference.py +1 -1
pix2struct/inference.py
CHANGED
@@ -3,7 +3,6 @@ import dataclasses
|
|
3 |
import json
|
4 |
from typing import Generator, Any
|
5 |
|
6 |
-
from accelerate import Accelerator
|
7 |
from transformers import T5TokenizerFast
|
8 |
import numpy as np
|
9 |
import torch
|
@@ -176,6 +175,7 @@ def main():
|
|
176 |
args.add_argument('--queries', type=str, required=True)
|
177 |
args = args.parse_args()
|
178 |
|
|
|
179 |
accelerator = Accelerator()
|
180 |
model = Pix2StructModel.load(args.model)
|
181 |
model = accelerator.prepare(model)
|
|
|
3 |
import json
|
4 |
from typing import Generator, Any
|
5 |
|
|
|
6 |
from transformers import T5TokenizerFast
|
7 |
import numpy as np
|
8 |
import torch
|
|
|
175 |
args.add_argument('--queries', type=str, required=True)
|
176 |
args = args.parse_args()
|
177 |
|
178 |
+
from accelerate import Accelerator
|
179 |
accelerator = Accelerator()
|
180 |
model = Pix2StructModel.load(args.model)
|
181 |
model = accelerator.prepare(model)
|