Spaces:
Runtime error
Runtime error
slightly increase repeat_penalty to reduce token repetition
Browse files
app.py
CHANGED
|
@@ -103,6 +103,7 @@ def caption_frame(frame):
|
|
| 103 |
messages=messages,
|
| 104 |
max_tokens=128,
|
| 105 |
temperature=0.1,
|
|
|
|
| 106 |
stop=["<end_of_utterance>"],
|
| 107 |
)
|
| 108 |
out = (resp["choices"][0].get("message", {}).get("content") or "").strip()
|
|
|
|
| 103 |
messages=messages,
|
| 104 |
max_tokens=128,
|
| 105 |
temperature=0.1,
|
| 106 |
+
repeat_penalty=1.1, # discourage exact token repeats
|
| 107 |
stop=["<end_of_utterance>"],
|
| 108 |
)
|
| 109 |
out = (resp["choices"][0].get("message", {}).get("content") or "").strip()
|