alexkueck commited on
Commit
40f9ca5
1 Parent(s): 4b94fc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -110,6 +110,7 @@ repo_id = "HuggingFaceH4/zephyr-7b-alpha" #das Modell ist echt gut!!! Vom MIT
110
 
111
  #HuggingFace Model name--------------------------------
112
  MODEL_NAME_HF = "mistralai/Mixtral-8x7B-Instruct-v0.1"
 
113
 
114
  ################################################
115
  #HF Hub Zugriff ermöglichen
@@ -323,8 +324,10 @@ def invoke (prompt, history, rag_option, model_option, openai_api_key, k=3, top_
323
  global splittet
324
  print(splittet)
325
  #Prompt an history anhängen und einen Text daraus machen
326
- history_text_und_prompt = generate_prompt_with_history(prompt, history)
327
-
 
 
328
  #history für HuggingFace Models formatieren
329
  #history_text_und_prompt = generate_prompt_with_history_hf(prompt, history)
330
 
@@ -348,7 +351,11 @@ def invoke (prompt, history, rag_option, model_option, openai_api_key, k=3, top_
348
  ###########################
349
  if (model_option == "OpenAI"):
350
  #Anfrage an OpenAI ----------------------------
351
- llm = ChatOpenAI(model_name = MODEL_NAME, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
 
 
 
 
352
  print("openAI")
353
  else:
354
  #oder an Hugging Face --------------------------
 
110
 
111
  #HuggingFace Model name--------------------------------
112
  MODEL_NAME_HF = "mistralai/Mixtral-8x7B-Instruct-v0.1"
113
+ MODEL_NAME_OAI_ZEICHNEN = "dall-e-3"
114
 
115
  ################################################
116
  #HF Hub Zugriff ermöglichen
 
324
  global splittet
325
  print(splittet)
326
  #Prompt an history anhängen und einen Text daraus machen
327
+ if (file == None):
328
+ history_text_und_prompt = generate_prompt_with_history(prompt, history)
329
+ else:
330
+ history_file_und_prompt = generate_prompt_with_history(prompt, history)
331
  #history für HuggingFace Models formatieren
332
  #history_text_und_prompt = generate_prompt_with_history_hf(prompt, history)
333
 
 
351
  ###########################
352
  if (model_option == "OpenAI"):
353
  #Anfrage an OpenAI ----------------------------
354
+ if (file == None):
355
+ llm = ChatOpenAI(model_name = MODEL_NAME, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
356
+ else: MODEL_NAME_OAI_ZEICHNEN
357
+ llm = ChatOpenAI(model_name = MODEL_NAME_OAI_ZEICHNEN, openai_api_key = openai_api_key, temperature=temperature)#, top_p = top_p)
358
+
359
  print("openAI")
360
  else:
361
  #oder an Hugging Face --------------------------