Update app.py
Browse files
app.py
CHANGED
@@ -384,13 +384,11 @@ def invoke (prompt, file, history, rag_option, model_option, openai_api_key, k=3
|
|
384 |
#LLM auswählen (OpenAI oder HF)
|
385 |
###########################
|
386 |
if (model_option == "OpenAI"):
|
387 |
-
|
388 |
-
print ("text...........................")
|
389 |
-
print(text)
|
390 |
#Anfrage an OpenAI ----------------------------
|
391 |
-
if (
|
392 |
print("OpenAI zeichnen.......................")
|
393 |
-
llm = ChatOpenAI(model_name =
|
394 |
else:
|
395 |
print("OpenAI normal.......................")
|
396 |
llm = ChatOpenAI(model_name = MODEL_NAME, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
@@ -564,7 +562,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
564 |
|
565 |
# Chatbot
|
566 |
transfer_input_args = dict(
|
567 |
-
fn=add_text, inputs=[chatbot, user_input, upload], outputs=[chatbot,
|
568 |
)
|
569 |
|
570 |
predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
|
|
|
384 |
#LLM auswählen (OpenAI oder HF)
|
385 |
###########################
|
386 |
if (model_option == "OpenAI"):
|
387 |
+
|
|
|
|
|
388 |
#Anfrage an OpenAI ----------------------------
|
389 |
+
if (prompt.find('Bild zeichnen')):
|
390 |
print("OpenAI zeichnen.......................")
|
391 |
+
llm = ChatOpenAI(model_name = MODEL_NAME_OAI_ZEICHNEN, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
392 |
else:
|
393 |
print("OpenAI normal.......................")
|
394 |
llm = ChatOpenAI(model_name = MODEL_NAME, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
|
|
|
562 |
|
563 |
# Chatbot
|
564 |
transfer_input_args = dict(
|
565 |
+
fn=add_text, inputs=[chatbot, user_input, upload], outputs=[chatbot, user_question, user_input], show_progress=True
|
566 |
)
|
567 |
|
568 |
predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
|