Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,8 +37,16 @@ model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
| 37 |
processor = AutoProcessor.from_pretrained(MODEL_DIR)
|
| 38 |
|
| 39 |
# --------- Chat Inference Function ---------
|
| 40 |
-
def chat_qwen_vl(
|
| 41 |
# ββ εζε€ζ¨‘ζθΎε
₯ζι ββ #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
text = processor.apply_chat_template(
|
| 43 |
messages, tokenize=False, add_generation_prompt=True
|
| 44 |
)
|
|
|
|
| 37 |
processor = AutoProcessor.from_pretrained(MODEL_DIR)
|
| 38 |
|
| 39 |
# --------- Chat Inference Function ---------
|
| 40 |
+
def chat_qwen_vl(message: str, history: list, temperature: float = 0.1, max_new_tokens: int = 1024):
|
| 41 |
# ββ εζε€ζ¨‘ζθΎε
₯ζι ββ #
|
| 42 |
+
messages = [
|
| 43 |
+
{
|
| 44 |
+
"role": "user",
|
| 45 |
+
"content": [
|
| 46 |
+
{"type": "text", "text": message},
|
| 47 |
+
],
|
| 48 |
+
}
|
| 49 |
+
]
|
| 50 |
text = processor.apply_chat_template(
|
| 51 |
messages, tokenize=False, add_generation_prompt=True
|
| 52 |
)
|