alexkueck commited on
Commit
5e08303
1 Parent(s): 9400523

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -372,13 +372,14 @@ def generate_auswahl(prompt, file, history, rag_option, model_option, openai_api
372
  print("history zeichnen......................")
373
  print(history)
374
  return history, "Success"
375
- """
376
  else:
377
  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,)
378
  #Antwort als Stream ausgeben... wenn Textantwort gefordert
379
  print("history vor Zusatz...........")
380
  print(history)
381
- history[-1][1] = ""
 
 
382
  for character in result:
383
  history[-1][1] += character
384
  time.sleep(0.03)
@@ -390,7 +391,7 @@ def generate_auswahl(prompt, file, history, rag_option, model_option, openai_api
390
  return
391
  except:
392
  pass
393
- """
394
 
395
  def generate_bild(prompt):
396
  data = {"inputs": prompt}
@@ -499,7 +500,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
499
  with gr.Row():
500
  with gr.Column(scale=5):
501
  with gr.Row():
502
- chatbot = gr.Chatbot(elem_id="chuanhu_chatbot")
503
  with gr.Row():
504
  with gr.Column(scale=12):
505
  user_input = gr.Textbox(
 
372
  print("history zeichnen......................")
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)
380
+ history[-1][1] = result
381
+ return history, "Success"
382
+ """
383
  for character in result:
384
  history[-1][1] += character
385
  time.sleep(0.03)
 
391
  return
392
  except:
393
  pass
394
+ """
395
 
396
  def generate_bild(prompt):
397
  data = {"inputs": prompt}
 
500
  with gr.Row():
501
  with gr.Column(scale=5):
502
  with gr.Row():
503
+ chatbot = gr.Chatbot(elem_id="chuanhu_chatbot", live=True)
504
  with gr.Row():
505
  with gr.Column(scale=12):
506
  user_input = gr.Textbox(