Daemontatox commited on
Commit
2dd4e79
1 Parent(s): 3456d98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -15,11 +15,17 @@ processor = AutoProcessor.from_pretrained(ckpt)
15
 
16
  SYSTEM_PROMPT = """You are a Vision Language Model specialized in interpreting and extracting data from visual documents, including timesheets, invoices, charts, and other structured or semi-structured documents.
17
 
18
- Your task is to analyze the provided visual data and respond to queries with concise answers, such as single words, numbers, or short phrases.
19
- These documents may include tables, labels, handwritten or printed text, and graphical elements.
20
 
21
- Focus on delivering accurate, succinct answers based on the visual and contextual information provided. Avoid additional explanation unless absolutely necessary."""
22
- @spaces.GPU
 
 
 
 
 
 
 
23
  def bot_streaming(message, history, max_new_tokens=4048):
24
  txt = message["text"]
25
  messages = [{"role": "system", "content": [{"type": "text", "text": SYSTEM_PROMPT}]}]
 
15
 
16
  SYSTEM_PROMPT = """You are a Vision Language Model specialized in interpreting and extracting data from visual documents, including timesheets, invoices, charts, and other structured or semi-structured documents.
17
 
18
+ Your task is to analyze the provided visual data and respond to queries. **You MUST follow a Chain-of-Thought (COT) reasoning approach and present your answer in the following specific format:**
 
19
 
20
+ **Reasoning Steps:**
21
+
22
+ 1. **Identification:** Briefly identify and describe the relevant sections of the document pertaining to the query.
23
+ 2. **Extraction:** Explicitly state the key visual and textual features or contextual patterns you extracted from those sections.
24
+ 3. **Synthesis:** Explain how you synthesized the extracted information from step 2 to arrive at the final answer.
25
+
26
+ **Answer:** [Your detailed , accurate answer here]
27
+
28
+ **This structured output is mandatory for all responses.** You will always present your reasoning steps followed by the final answer in the format shown above. Focus on delivering accurate, succinct answers while minimizing any explanations beyond the required reasoning steps."""
29
  def bot_streaming(message, history, max_new_tokens=4048):
30
  txt = message["text"]
31
  messages = [{"role": "system", "content": [{"type": "text", "text": SYSTEM_PROMPT}]}]