Travad98 commited on
Commit
9d01c64
1 Parent(s): 381cba1

Upadated with random example

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -1,14 +1,14 @@
1
  import re
2
  import gradio as gr
3
 
4
- # import torch
5
  from transformers import DonutProcessor, VisionEncoderDecoderModel
6
 
7
  processor = DonutProcessor.from_pretrained("Travad98/donut-finetuned-sogc-trademarks-1883-2001")
8
  model = VisionEncoderDecoderModel.from_pretrained("Travad98/donut-finetuned-sogc-trademarks-1883-2001")
9
 
10
- # device = "cuda" if torch.cuda.is_available() else "cpu"
11
- # model.to(device)
12
 
13
  def process_document(image):
14
  # prepare encoder inputs
@@ -50,7 +50,7 @@ demo = gr.Interface(
50
  description=description,
51
  article=article,
52
  enable_queue=True,
53
- examples=[["example.png"], ["example_2.png"], ["example_3.png"]],
54
  cache_examples=False)
55
 
56
  demo.launch()
 
1
  import re
2
  import gradio as gr
3
 
4
+ import torch
5
  from transformers import DonutProcessor, VisionEncoderDecoderModel
6
 
7
  processor = DonutProcessor.from_pretrained("Travad98/donut-finetuned-sogc-trademarks-1883-2001")
8
  model = VisionEncoderDecoderModel.from_pretrained("Travad98/donut-finetuned-sogc-trademarks-1883-2001")
9
 
10
+ device = "cuda" if torch.cuda.is_available() else "cpu"
11
+ model.to(device)
12
 
13
  def process_document(image):
14
  # prepare encoder inputs
 
50
  description=description,
51
  article=article,
52
  enable_queue=True,
53
+ examples=[["sha-001_1883_1__21_d-0-6.jpg"]],
54
  cache_examples=False)
55
 
56
  demo.launch()