nkasmanoff commited on
Commit
7ec2928
·
1 Parent(s): 04baa0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -2
app.py CHANGED
@@ -10,7 +10,6 @@ processor = AutoProcessor.from_pretrained("microsoft/git-base")
10
  model = AutoModelForCausalLM.from_pretrained("nkasmanoff/git-planet").to(device)
11
 
12
 
13
-
14
  def predict(image,max_length=64,device='cpu'):
15
  pixel_values = processor(images=image, return_tensors="pt").to(device).pixel_values
16
  generated_ids = model.generate(pixel_values=pixel_values, max_length=max_length)
@@ -19,7 +18,6 @@ def predict(image,max_length=64,device='cpu'):
19
  return generated_caption
20
 
21
 
22
-
23
  input = gr.inputs.Image(label="Upload your Image", type = 'pil', optional=True)
24
  output = gr.outputs.Textbox(type="text",label="Captions")
25
 
 
10
  model = AutoModelForCausalLM.from_pretrained("nkasmanoff/git-planet").to(device)
11
 
12
 
 
13
  def predict(image,max_length=64,device='cpu'):
14
  pixel_values = processor(images=image, return_tensors="pt").to(device).pixel_values
15
  generated_ids = model.generate(pixel_values=pixel_values, max_length=max_length)
 
18
  return generated_caption
19
 
20
 
 
21
  input = gr.inputs.Image(label="Upload your Image", type = 'pil', optional=True)
22
  output = gr.outputs.Textbox(type="text",label="Captions")
23