szymmon commited on
Commit
730c387
·
1 Parent(s): 7a9fb99
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -37,6 +37,10 @@ class SimpleVLMInterface:
37
  top_p=0.95
38
  ):
39
  try:
 
 
 
 
40
  # Prepare the input text
41
  messages = [{"role": "user", "content": text_input}]
42
  chat_input = self.processor.apply_chat_template(
@@ -52,6 +56,8 @@ class SimpleVLMInterface:
52
  else:
53
  image_inputs = None
54
 
 
 
55
  # Prepare model inputs
56
  model_inputs = self.processor(
57
  text=chat_input,
 
37
  top_p=0.95
38
  ):
39
  try:
40
+
41
+ if image is not None:
42
+ text_input = f"<image>{text_input}"
43
+
44
  # Prepare the input text
45
  messages = [{"role": "user", "content": text_input}]
46
  chat_input = self.processor.apply_chat_template(
 
56
  else:
57
  image_inputs = None
58
 
59
+
60
+
61
  # Prepare model inputs
62
  model_inputs = self.processor(
63
  text=chat_input,