merve HF staff commited on
Commit
7bf31d2
1 Parent(s): 3e8cc16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ import torch
8
  import gradio as gr
9
  import uuid
10
  import os
11
-
12
  processor = NougatProcessor.from_pretrained("facebook/nougat-small")
13
  model = VisionEncoderDecoderModel.from_pretrained("facebook/nougat-small")
14
 
@@ -30,7 +30,7 @@ def get_pdf(pdf_link):
30
  return unique_filename
31
 
32
 
33
-
34
  def predict(image):
35
  # prepare PDF image for the model
36
  image = Image.open(image)
 
8
  import gradio as gr
9
  import uuid
10
  import os
11
+ import spaces
12
  processor = NougatProcessor.from_pretrained("facebook/nougat-small")
13
  model = VisionEncoderDecoderModel.from_pretrained("facebook/nougat-small")
14
 
 
30
  return unique_filename
31
 
32
 
33
+ @spaces.GPU
34
  def predict(image):
35
  # prepare PDF image for the model
36
  image = Image.open(image)