alexkueck commited on
Commit
c0e5b31
1 Parent(s): 191b138

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -364,8 +364,8 @@ def umwandeln_fuer_anzeige(image):
364
 
365
  def generate_auswahl(prompt, file, history, rag_option, model_option, openai_api_key, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,):
366
  if (prompt.find('zeichnen') != -1):
367
- result = generate_bild(prompt, file, history, rag_option, model_option, openai_api_key, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,)
368
- #Bild ausgeben
369
  image = Image.open(io.BytesIO(result))
370
 
371
  history[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(b64encode(umwandeln_fuer_anzeige(image)).decode('utf-8'))
@@ -373,7 +373,7 @@ def generate_auswahl(prompt, file, history, rag_option, model_option, openai_api
373
  print(history)
374
  return history, "Success"
375
  else:
376
- result = generate_text(prompt, file, history, rag_option, model_option, openai_api_key, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,)
377
  #Antwort als Stream ausgeben... wenn Textantwort gefordert
378
  print("history vor Zusatz...........")
379
  print(history)
 
364
 
365
  def generate_auswahl(prompt, file, history, rag_option, model_option, openai_api_key, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,):
366
  if (prompt.find('zeichnen') != -1):
367
+ result = generate_bild(prompt, file, history, rag_option, model_option, openai_api_key, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,)
368
+ #Bild ausgeben
369
  image = Image.open(io.BytesIO(result))
370
 
371
  history[-1][1] = "<img src='data:image/png;base64,{0}'/>".format(b64encode(umwandeln_fuer_anzeige(image)).decode('utf-8'))
 
373
  print(history)
374
  return history, "Success"
375
  else:
376
+ result = generate_text(prompt, file, history, rag_option, model_option, openai_api_key, k=3, top_p=0.6, temperature=0.5, max_new_tokens=4048, max_context_length_tokens=2048, repetition_penalty=1.3,)
377
  #Antwort als Stream ausgeben... wenn Textantwort gefordert
378
  print("history vor Zusatz...........")
379
  print(history)