1inkusFace commited on
Commit
423ee98
·
verified ·
1 Parent(s): 198e86a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -259,7 +259,11 @@ def captioning(img):
259
  cap_prompt = (
260
  "Describe this image with a caption to be used for image generation."
261
  )
 
 
 
262
  inputsa = processor5(images=img, text=cap_prompt, return_tensors="pt").to('cuda')
 
263
  '''
264
  generated_ids = model5.generate(
265
  **inputsa,
@@ -288,7 +292,7 @@ def captioning(img):
288
  generated_text = processor5.batch_decode(generated_ids, skip_special_tokens=True)[0].strip()
289
 
290
  generated_idsb = model5.generate(
291
- **inputsa,
292
  do_sample=True,
293
  num_beams=1,
294
  max_length=16,
 
259
  cap_prompt = (
260
  "Describe this image with a caption to be used for image generation."
261
  )
262
+ cap_prompt2 = (
263
+ "Describe this image."
264
+ )
265
  inputsa = processor5(images=img, text=cap_prompt, return_tensors="pt").to('cuda')
266
+ inputsb = processor5(images=img, text=cap_prompt, return_tensors="pt").to('cuda')
267
  '''
268
  generated_ids = model5.generate(
269
  **inputsa,
 
292
  generated_text = processor5.batch_decode(generated_ids, skip_special_tokens=True)[0].strip()
293
 
294
  generated_idsb = model5.generate(
295
+ **inputsb,
296
  do_sample=True,
297
  num_beams=1,
298
  max_length=16,