Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,12 +15,6 @@ args, left_argv = parser.parse_known_args()
|
|
15 |
task_name = args.task
|
16 |
task_prompt = f"<s_{task_name}>"
|
17 |
model = DonutModel.from_pretrained("uartimcs/donut-booking-extract")
|
18 |
-
if torch.cuda.is_available():
|
19 |
-
model.half()
|
20 |
-
device = torch.device("cuda")
|
21 |
-
model.to(device)
|
22 |
-
else:
|
23 |
-
model.encoder.to(torch.bfloat16)
|
24 |
model.eval()
|
25 |
demo = gr.Interface(fn=demo_process,inputs="image",outputs="json", title=f"Donut 🍩 demonstration for `{task_name}` task",)
|
26 |
demo.launch()
|
|
|
15 |
task_name = args.task
|
16 |
task_prompt = f"<s_{task_name}>"
|
17 |
model = DonutModel.from_pretrained("uartimcs/donut-booking-extract")
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
model.eval()
|
19 |
demo = gr.Interface(fn=demo_process,inputs="image",outputs="json", title=f"Donut 🍩 demonstration for `{task_name}` task",)
|
20 |
demo.launch()
|