umangchaudhry commited on
Commit
07b6e36
·
1 Parent(s): 342bac4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -73,10 +73,11 @@ with gr.Blocks() as demo:
73
  with gr.Tab("Coding Assistant"):
74
  api_check_button = gr.Button("Get API Key")
75
  api_print = gr.Textbox(label = "OpenAI API Key - Please ensure the API Key is set correctly")
76
- model_selection = gr.CheckboxGroup(
77
  ["gpt-3.5-turbo", "gpt-4"], label="Model Selection", info="Please ensure you provide the API Key that corresponds to the Model you select!"
78
  )
79
  model_submit_button = gr.Button("Submit Model Selection")
 
80
  chatbot = gr.Chatbot(label="ChatGPT Powered Coding Assistant")
81
  msg = gr.Textbox(label="User Prompt", placeholder="Your Query Here")
82
  clear = gr.Button("Clear")
@@ -84,7 +85,7 @@ with gr.Blocks() as demo:
84
  api_submit_button.click(set_api_key, inputs=api_input, outputs=api_key_status)
85
  api_reset_button.click(reset_api_key, outputs=api_key_status)
86
  api_check_button.click(get_api_key, outputs=api_print)
87
- model_submit_button.click(set_model, inputs=model_selection)
88
  msg.submit(respond, inputs = [msg, chatbot], outputs = [msg, chatbot])
89
  clear.click(lambda: None, None, chatbot, queue=False)
90
 
 
73
  with gr.Tab("Coding Assistant"):
74
  api_check_button = gr.Button("Get API Key")
75
  api_print = gr.Textbox(label = "OpenAI API Key - Please ensure the API Key is set correctly")
76
+ model_selection = gr.Dropdown(
77
  ["gpt-3.5-turbo", "gpt-4"], label="Model Selection", info="Please ensure you provide the API Key that corresponds to the Model you select!"
78
  )
79
  model_submit_button = gr.Button("Submit Model Selection")
80
+ model_status = gr.Checkbox("Selected Model", interactive = False)
81
  chatbot = gr.Chatbot(label="ChatGPT Powered Coding Assistant")
82
  msg = gr.Textbox(label="User Prompt", placeholder="Your Query Here")
83
  clear = gr.Button("Clear")
 
85
  api_submit_button.click(set_api_key, inputs=api_input, outputs=api_key_status)
86
  api_reset_button.click(reset_api_key, outputs=api_key_status)
87
  api_check_button.click(get_api_key, outputs=api_print)
88
+ model_submit_button.click(set_model, inputs=model_selection, outputs=model_status)
89
  msg.submit(respond, inputs = [msg, chatbot], outputs = [msg, chatbot])
90
  clear.click(lambda: None, None, chatbot, queue=False)
91