uartimcs commited on
Commit
4825a6d
1 Parent(s): 93e3f17

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -6
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()