sav7669 commited on
Commit
2838f66
1 Parent(s): 19f7687

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -10,9 +10,11 @@ from PIL import Image
10
 
11
  from donut import DonutModel
12
  from transformers import DonutProcessor, VisionEncoderDecoderModel
13
- #from huggingface_hub import notebook_login
 
 
 
14
 
15
- #huggingface_hub.notebook_login(token=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)
16
 
17
  def demo_process(input_img):
18
  global pretrained_model, task_prompt, task_name
@@ -33,8 +35,8 @@ image.save("sroie_test2.jpg")
33
 
34
  #philschmid
35
  pretrained_model = DonutModel.from_pretrained("philschmid/donut-base-sroie")
36
- model = VisionEncoderDecoderModel.from_pretrained("philschmid/donut-base-sroie")
37
- model.eval()
38
 
39
  demo = gr.Interface(
40
  fn=demo_process,
 
10
 
11
  from donut import DonutModel
12
  from transformers import DonutProcessor, VisionEncoderDecoderModel
13
+ from huggingface_hub import notebook_login
14
+
15
+ HF_TOKEN = os.environ.get("HF_TOKEN", None)
16
+ huggingface_hub.notebook_login(token=HF_TOKEN)
17
 
 
18
 
19
  def demo_process(input_img):
20
  global pretrained_model, task_prompt, task_name
 
35
 
36
  #philschmid
37
  pretrained_model = DonutModel.from_pretrained("philschmid/donut-base-sroie")
38
+ #model = VisionEncoderDecoderModel.from_pretrained("philschmid/donut-base-sroie")
39
+ pretrained_model.eval()
40
 
41
  demo = gr.Interface(
42
  fn=demo_process,