Spaces:
Runtime error
Runtime error
Commit Β·
5ceb817
1
Parent(s): cd7aae8
Remove chat template from tiny mode
Browse files
app.py
CHANGED
|
@@ -309,15 +309,6 @@ def score_binary_logits(logits: torch.Tensor, tokenizer) -> tuple[float, str]:
|
|
| 309 |
|
| 310 |
|
| 311 |
def build_prompt(processor_obj, user_text: str) -> str:
|
| 312 |
-
messages = [
|
| 313 |
-
{
|
| 314 |
-
"role": "user",
|
| 315 |
-
"content": f"<image>\n{user_text}",
|
| 316 |
-
}
|
| 317 |
-
]
|
| 318 |
-
tokenizer = getattr(processor_obj, "tokenizer", None)
|
| 319 |
-
if tokenizer is not None and hasattr(tokenizer, "apply_chat_template"):
|
| 320 |
-
return tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 321 |
return f"<image>\n{user_text}"
|
| 322 |
|
| 323 |
|
|
|
|
| 309 |
|
| 310 |
|
| 311 |
def build_prompt(processor_obj, user_text: str) -> str:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
return f"<image>\n{user_text}"
|
| 313 |
|
| 314 |
|