ndurner commited on
Commit
90b6fdb
·
1 Parent(s): 31aea72
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -225,7 +225,7 @@ def bot(message, history, oai_key, system_prompt, seed, temperature, max_tokens,
225
  user_msg_parts = []
226
 
227
  if system_prompt:
228
- if not model.startswith("o1"):
229
  role = "system"
230
  else:
231
  role = "developer"
@@ -256,7 +256,7 @@ def bot(message, history, oai_key, system_prompt, seed, temperature, max_tokens,
256
  if log_to_console:
257
  print(f"br_prompt: {str(history_openai_format)}")
258
 
259
- if model in ["o1", "o1-high", "o1-2024-12-17"]:
260
  response = client.chat.completions.create(
261
  model="o1" if model == "o1-high" else model,
262
  messages= history_openai_format,
@@ -411,7 +411,7 @@ with gr.Blocks(delete_cache=(86400, 86400)) as demo:
411
 
412
  oai_key = gr.Textbox(label="OpenAI API Key", elem_id="oai_key")
413
  model = gr.Dropdown(label="Model", value="gpt-4-turbo", allow_custom_value=True, elem_id="model",
414
- choices=["gpt-4-turbo", "gpt-4o-2024-05-13", "gpt-4o-2024-11-20", "o1-high", "o1-mini", "o1", "o1-preview", "chatgpt-4o-latest", "gpt-4o", "gpt-4o-mini", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-vision-preview", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-1106", "whisper", "dall-e-3"])
415
  system_prompt = gr.TextArea("You are a helpful yet diligent AI assistant. Answer faithfully and factually correct. Respond with 'I do not know' if uncertain.", label="System/Developer Prompt", lines=3, max_lines=250, elem_id="system_prompt")
416
  seed = gr.Textbox(label="Seed", elem_id="seed")
417
  temp = gr.Slider(0, 2, label="Temperature", elem_id="temp", value=1)
 
225
  user_msg_parts = []
226
 
227
  if system_prompt:
228
+ if not model.startswith("o"):
229
  role = "system"
230
  else:
231
  role = "developer"
 
256
  if log_to_console:
257
  print(f"br_prompt: {str(history_openai_format)}")
258
 
259
+ if model in ["o1", "o1-high", "o1-2024-12-17", "o3-mini"]:
260
  response = client.chat.completions.create(
261
  model="o1" if model == "o1-high" else model,
262
  messages= history_openai_format,
 
411
 
412
  oai_key = gr.Textbox(label="OpenAI API Key", elem_id="oai_key")
413
  model = gr.Dropdown(label="Model", value="gpt-4-turbo", allow_custom_value=True, elem_id="model",
414
+ choices=["gpt-4-turbo", "gpt-4o-2024-05-13", "gpt-4o-2024-11-20", "o1-high", "o1-mini", "o1", "o3-mini", "o1-preview", "chatgpt-4o-latest", "gpt-4o", "gpt-4o-mini", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4", "gpt-4-vision-preview", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-1106", "whisper", "dall-e-3"])
415
  system_prompt = gr.TextArea("You are a helpful yet diligent AI assistant. Answer faithfully and factually correct. Respond with 'I do not know' if uncertain.", label="System/Developer Prompt", lines=3, max_lines=250, elem_id="system_prompt")
416
  seed = gr.Textbox(label="Seed", elem_id="seed")
417
  temp = gr.Slider(0, 2, label="Temperature", elem_id="temp", value=1)