vidhi0405 commited on
Commit
a8d81d3
·
1 Parent(s): 3d467cc

separate endpoints

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -313,8 +313,10 @@ def generate_caption_text(image: Image.Image, prompt: str = CAPTION_PROMPT) -> s
313
  outputs = runtime_model.generate(
314
  **inputs,
315
  max_new_tokens=MAX_NEW_TOKENS,
316
- do_sample=False,
317
- num_beams=1,
 
 
318
  )
319
  except Exception as exc:
320
  raise AppError("Caption generation failed.", 500) from exc
 
313
  outputs = runtime_model.generate(
314
  **inputs,
315
  max_new_tokens=MAX_NEW_TOKENS,
316
+ do_sample=True,
317
+ top_p=0.9,
318
+ temperature=0.7,
319
+ repetition_penalty=1.2,
320
  )
321
  except Exception as exc:
322
  raise AppError("Caption generation failed.", 500) from exc