yasserrmd commited on
Commit
12dc835
1 Parent(s): 0fda7e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -156,7 +156,7 @@ SCHEMA_DEFINITION= """{
156
  "Recommended_Actions"
157
  ]
158
  }"""
159
- SYSTEM_INNSTRUCTION="You are a router troubleshooter. Your job is to analyze the provided router image, identify potential issues such as faulty connections, incorrect LED patterns, or error codes, and offer precise troubleshooting steps. Based on your analysis, generate a detailed observation that includes a root cause analysis, step-by-step actions for resolving the issue, and recommended preventive measures. The output must be in JSON format as per the following schema, ensuring users can easily follow and implement the suggested solutions.\n" + SCHEMA_DEFINITION
160
 
161
 
162
  model_id = "meta-llama/Llama-3.2-11B-Vision-Instruct"
@@ -198,13 +198,9 @@ def diagnose_router(image):
198
 
199
 
200
  messages = [
201
- {"role": "system",
202
- "content": [{"type": "text",
203
- "text": SYSTEM_INNSTRUCTION}],
204
- },
205
  {"role": "user", "content": [
206
  {"type": "image"},
207
- {"type": "text", "text": "Analyze this router issue and provide the diagnosis."}
208
  ]}
209
  ]
210
  input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
 
156
  "Recommended_Actions"
157
  ]
158
  }"""
159
+ SYSTEM_INSTRUCTION="You are a router troubleshooter. Your job is to analyze the provided router image, identify potential issues such as faulty connections, incorrect LED patterns, or error codes, and offer precise troubleshooting steps. Based on your analysis, generate a detailed observation that includes a root cause analysis, step-by-step actions for resolving the issue, and recommended preventive measures. The output must be in JSON format as per the following schema, ensuring users can easily follow and implement the suggested solutions.\n" + SCHEMA_DEFINITION
160
 
161
 
162
  model_id = "meta-llama/Llama-3.2-11B-Vision-Instruct"
 
198
 
199
 
200
  messages = [
 
 
 
 
201
  {"role": "user", "content": [
202
  {"type": "image"},
203
+ {"type": "text", "text": SYSTEM_INSTRUCTION}
204
  ]}
205
  ]
206
  input_text = processor.apply_chat_template(messages, add_generation_prompt=True)