visheratin commited on
Commit
b896e6c
·
verified ·
1 Parent(s): 93c40a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -45,6 +45,11 @@ def cached_vision_process(image, max_crops, num_tokens):
45
  def answer_question(image, question, max_crops, num_tokens):
46
  prompt = f"""<|im_start|>user
47
  <image>
 
 
 
 
 
48
  {question}<|im_end|>
49
  <|im_start|>assistant
50
  """
@@ -69,7 +74,7 @@ def answer_question(image, question, max_crops, num_tokens):
69
  buffer += new_text
70
  print(buffer)
71
  if len(buffer) > 1:
72
- yield buffer
73
 
74
 
75
  with gr.Blocks() as demo:
 
45
  def answer_question(image, question, max_crops, num_tokens):
46
  prompt = f"""<|im_start|>user
47
  <image>
48
+ {question}<|im_end|>
49
+ <|im_start|>assistant
50
+ """
51
+ replace_prompt = f"""<|im_start|>user
52
+
53
  {question}<|im_end|>
54
  <|im_start|>assistant
55
  """
 
74
  buffer += new_text
75
  print(buffer)
76
  if len(buffer) > 1:
77
+ yield buffer.replace(replace_prompt, "")
78
 
79
 
80
  with gr.Blocks() as demo: