alexkueck commited on
Commit
3d1f254
1 Parent(s): e42a55b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -412,7 +412,7 @@ def generate_prompt_with_history_langchain(prompt, history):
412
  def generate_auswahl(prompt, file, chatbot, 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,):
413
  #kein Bild hochgeladen -> auf Text antworten...
414
  if (file == None):
415
- result = generate_text(prompt, file, chatbot, 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,)
416
  history = history + [(prompt, result)]
417
  #Antwort als Stream ausgeben... wenn Textantwort gefordert
418
  else:
@@ -465,7 +465,7 @@ def generate_text_zu_bild(file, prompt):
465
  ####################################################
466
  #aus einem Text-Prompt die Antwort von KI bekommen
467
  #mit oder ohne RAG möglich
468
- def generate_text (prompt, file, chatbot, 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,):
469
  global splittet
470
  print(splittet)
471
 
@@ -479,7 +479,7 @@ def generate_text (prompt, file, chatbot, history, rag_option, model_option, ope
479
  raise gr.Error("Prompt ist erforderlich.")
480
 
481
  #Prompt an history anhängen und einen Text daraus machen
482
- history_text_und_prompt = generate_prompt_with_history_openai(prompt, history)
483
  print("hist_text...................")
484
  print(history_text_und_prompt)
485
  #history für HuggingFace Models formatieren
 
412
  def generate_auswahl(prompt, file, chatbot, 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,):
413
  #kein Bild hochgeladen -> auf Text antworten...
414
  if (file == None):
415
+ result = generate_text(prompt, chatbot, 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,)
416
  history = history + [(prompt, result)]
417
  #Antwort als Stream ausgeben... wenn Textantwort gefordert
418
  else:
 
465
  ####################################################
466
  #aus einem Text-Prompt die Antwort von KI bekommen
467
  #mit oder ohne RAG möglich
468
+ def generate_text (prompt, chatbot, 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,):
469
  global splittet
470
  print(splittet)
471
 
 
479
  raise gr.Error("Prompt ist erforderlich.")
480
 
481
  #Prompt an history anhängen und einen Text daraus machen
482
+ history_text_und_prompt = generate_prompt_with_history(prompt, history)
483
  print("hist_text...................")
484
  print(history_text_und_prompt)
485
  #history für HuggingFace Models formatieren