tommy24 commited on
Commit
85185f1
·
1 Parent(s): 7f5102c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -185,6 +185,9 @@ with open("labels.txt", "r") as file:
185
 
186
  def classify(UserInput, Image, Textbox2, Textbox3):
187
  if Textbox3 == code:
 
 
 
188
  if Image is not None:
189
  output = []
190
  image_data = np.array(Image)
@@ -208,10 +211,7 @@ def classify(UserInput, Image, Textbox2, Textbox3):
208
  Textbox2_edited = [x.strip() for x in Textbox2]
209
  Textbox2_edited = list(Textbox2_edited)
210
  Textbox2_edited.append(UserInput)
211
- messages = [
212
- {"role": "system", "content": system},
213
- {"role": "user", "content": UserInput},
214
- ]
215
 
216
  for i, label in enumerate(labels):
217
  prediction_value = float(prediction[0][i])
 
185
 
186
  def classify(UserInput, Image, Textbox2, Textbox3):
187
  if Textbox3 == code:
188
+ messages = [
189
+ {"role": "system", "content": system}
190
+ ]
191
  if Image is not None:
192
  output = []
193
  image_data = np.array(Image)
 
211
  Textbox2_edited = [x.strip() for x in Textbox2]
212
  Textbox2_edited = list(Textbox2_edited)
213
  Textbox2_edited.append(UserInput)
214
+ messages.append({"role": "user", "content": UserInput})
 
 
 
215
 
216
  for i, label in enumerate(labels):
217
  prediction_value = float(prediction[0][i])