yejunliang23 commited on
Commit
6b13d30
Β·
unverified Β·
1 Parent(s): ed6be3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
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(messages: str, history: list, temperature: float = 0.1, max_new_tokens: int = 1024):
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
  )