Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -64,8 +64,8 @@ def clear():
|
|
64 |
def updatePassword(txt):
|
65 |
return [txt.lower(), "*********"]
|
66 |
|
67 |
-
def setModel(val):
|
68 |
-
|
69 |
|
70 |
def chat(prompt, user_window, pwd_window, past, response, gptModel):
|
71 |
user_window = user_window.lower()
|
@@ -116,9 +116,9 @@ def new_func(user_window):
|
|
116 |
with gr.Blocks() as demo:
|
117 |
history = gr.State([])
|
118 |
password = gr.State("")
|
119 |
-
model = gr.State("gpt-
|
120 |
gr.Markdown('# GPT Chat')
|
121 |
-
gr.Markdown('Enter user name & password then enter prompt and click submit button.
|
122 |
# heading = gr.Label(value="GPT Chat", scale=2, color="Crimson" )
|
123 |
with gr.Row():
|
124 |
user_window = gr.Textbox(label = "User Name")
|
@@ -126,13 +126,13 @@ with gr.Blocks() as demo:
|
|
126 |
pwd_window.blur(updatePassword, pwd_window, [password, pwd_window])
|
127 |
with gr.Row():
|
128 |
clear_button = gr.Button(value="Restart Conversation")
|
129 |
-
gpt_chooser=gr.Radio(choices=[("GPT-3.5","gpt-3.5-turbo"),("GPT-4o","gpt-4o-mini")],
|
130 |
-
|
131 |
submit_window = gr.Button(value="Submit Prompt/Question")
|
132 |
prompt_window = gr.Textbox(label = "Prompt or Question")
|
133 |
output_window = gr.Textbox(label = "Dialog")
|
134 |
submit_window.click(chat, inputs=[prompt_window, user_window, password, history, output_window, model],
|
135 |
outputs=[history, output_window, prompt_window])
|
136 |
clear_button.click(clear, inputs=[], outputs=[prompt_window, history, output_window])
|
137 |
-
gpt_chooser.input(fn=setModel, inputs=gpt_chooser, outputs=model)
|
138 |
demo.launch()
|
|
|
64 |
def updatePassword(txt):
|
65 |
return [txt.lower(), "*********"]
|
66 |
|
67 |
+
# def setModel(val):
|
68 |
+
# return val
|
69 |
|
70 |
def chat(prompt, user_window, pwd_window, past, response, gptModel):
|
71 |
user_window = user_window.lower()
|
|
|
116 |
with gr.Blocks() as demo:
|
117 |
history = gr.State([])
|
118 |
password = gr.State("")
|
119 |
+
model = gr.State("gpt-4o-mini")
|
120 |
gr.Markdown('# GPT Chat')
|
121 |
+
gr.Markdown('Enter user name & password then enter prompt and click submit button. Restart conversation if topic changes')
|
122 |
# heading = gr.Label(value="GPT Chat", scale=2, color="Crimson" )
|
123 |
with gr.Row():
|
124 |
user_window = gr.Textbox(label = "User Name")
|
|
|
126 |
pwd_window.blur(updatePassword, pwd_window, [password, pwd_window])
|
127 |
with gr.Row():
|
128 |
clear_button = gr.Button(value="Restart Conversation")
|
129 |
+
# gpt_chooser=gr.Radio(choices=[("GPT-3.5","gpt-3.5-turbo"),("GPT-4o","gpt-4o-mini")],
|
130 |
+
# value="gpt-3.5-turbo", label="GPT Model", interactive=True)
|
131 |
submit_window = gr.Button(value="Submit Prompt/Question")
|
132 |
prompt_window = gr.Textbox(label = "Prompt or Question")
|
133 |
output_window = gr.Textbox(label = "Dialog")
|
134 |
submit_window.click(chat, inputs=[prompt_window, user_window, password, history, output_window, model],
|
135 |
outputs=[history, output_window, prompt_window])
|
136 |
clear_button.click(clear, inputs=[], outputs=[prompt_window, history, output_window])
|
137 |
+
# gpt_chooser.input(fn=setModel, inputs=gpt_chooser, outputs=model)
|
138 |
demo.launch()
|