tangjicheng123 commited on
Commit
7725d56
1 Parent(s): 1f3f504

feat: clean output text

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -43,7 +43,7 @@ def inference_image_caption(raw_image):
43
  image = transform(raw_image).unsqueeze(0).to(device)
44
  with torch.no_grad():
45
  caption = model.generate(image, sample=True, top_p=0.9, max_length=20, min_length=5)
46
- return 'caption: '+caption[0]
47
 
48
  inputs = gr.Image(type='pil')
49
  outputs = gr.outputs.Textbox(label="Output")
 
43
  image = transform(raw_image).unsqueeze(0).to(device)
44
  with torch.no_grad():
45
  caption = model.generate(image, sample=True, top_p=0.9, max_length=20, min_length=5)
46
+ return caption[0]
47
 
48
  inputs = gr.Image(type='pil')
49
  outputs = gr.outputs.Textbox(label="Output")