Spaces:
Sleeping
Sleeping
separate endpoints
Browse files
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=
|
| 317 |
-
|
|
|
|
|
|
|
| 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
|