mjavaid commited on
Commit
b5a8693
·
1 Parent(s): ce1393b

first commit

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -39,13 +39,14 @@ def generate_response(user_text, user_image, history):
39
  # Attempt to extract the generated content using the expected structure.
40
  try:
41
  response = output[0][0]["generated_text"][-1]["content"]
 
 
42
  except (KeyError, IndexError, TypeError):
43
  # Fallback: return the raw output as a string.
44
  #print(response)
45
  pass
46
  #response = str(output)
47
 
48
- history.append((user_text, response))
49
  return history, history
50
 
51
  with gr.Blocks() as demo:
 
39
  # Attempt to extract the generated content using the expected structure.
40
  try:
41
  response = output[0][0]["generated_text"][-1]["content"]
42
+ history.append((user_text, response))
43
+
44
  except (KeyError, IndexError, TypeError):
45
  # Fallback: return the raw output as a string.
46
  #print(response)
47
  pass
48
  #response = str(output)
49
 
 
50
  return history, history
51
 
52
  with gr.Blocks() as demo: