Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -123,8 +123,12 @@ def _infer_image(image_path: str) -> str:
|
|
| 123 |
torch.cuda.empty_cache()
|
| 124 |
|
| 125 |
with torch.no_grad():
|
| 126 |
-
ids = model.generate(
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
result = processor.decode(
|
| 129 |
ids[0][inputs["input_ids"].shape[1]:],
|
| 130 |
skip_special_tokens=True,
|
|
|
|
| 123 |
torch.cuda.empty_cache()
|
| 124 |
|
| 125 |
with torch.no_grad():
|
| 126 |
+
ids = model.generate(
|
| 127 |
+
**inputs,
|
| 128 |
+
max_new_tokens=MAX_NEW_TOKENS,
|
| 129 |
+
do_sample=False,
|
| 130 |
+
repetition_penalty=1.1,
|
| 131 |
+
)
|
| 132 |
result = processor.decode(
|
| 133 |
ids[0][inputs["input_ids"].shape[1]:],
|
| 134 |
skip_special_tokens=True,
|