alexkueck commited on
Commit
b9f7822
1 Parent(s): 9569fab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -391,7 +391,7 @@ def generate_auswahl(prompt, file, chatbot, history, rag_option, model_option, o
391
  image = Image.open(io.BytesIO(result))
392
  image_64 = umwandeln_fuer_anzeige(image)
393
  chatbot[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(b64encode(image_64).decode('utf-8'))
394
- history = history + [[prompt, b64encode(image_64).decode('utf-8')]]
395
  print("history zeichnen......................")
396
  print(chatbot)
397
  return chatbot, history, "Success"
@@ -443,9 +443,11 @@ def generate_text (prompt, file, chatbot, history, rag_option, model_option, ope
443
  if (file == None):
444
  history_text_und_prompt = generate_prompt_with_history_openai(prompt, history)
445
  else:
446
- print("file....................")
447
  print(file)
448
- prompt_neu = prompt + b64encode(file).decode("utf-8").path()
 
 
449
  print("prompt_neu............................")
450
  print(prompt_neu)
451
  history_text_und_prompt = generate_prompt_with_history_openai(prompt_neu, history)
 
391
  image = Image.open(io.BytesIO(result))
392
  image_64 = umwandeln_fuer_anzeige(image)
393
  chatbot[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(b64encode(image_64).decode('utf-8'))
394
+ history = history + [[prompt, result]]
395
  print("history zeichnen......................")
396
  print(chatbot)
397
  return chatbot, history, "Success"
 
443
  if (file == None):
444
  history_text_und_prompt = generate_prompt_with_history_openai(prompt, history)
445
  else:
446
+ print("file bild uplad....................")
447
  print(file)
448
+ image = Image.open(io.BytesIO(file_anzeigen))
449
+ image_64 = umwandeln_fuer_anzeige(image)
450
+ prompt_neu = prompt + b64encode(image_64).decode("utf-8").path()
451
  print("prompt_neu............................")
452
  print(prompt_neu)
453
  history_text_und_prompt = generate_prompt_with_history_openai(prompt_neu, history)