Spaces:
Running
Running
hugforziio
commited on
Commit
•
ea4220d
1
Parent(s):
11018e3
Update app.py
Browse files
app.py
CHANGED
@@ -164,7 +164,7 @@ def on_click_send_btn(
|
|
164 |
def clear_history():
|
165 |
return [], ""
|
166 |
|
167 |
-
def copy_history():
|
168 |
pass
|
169 |
|
170 |
|
@@ -249,8 +249,8 @@ with gradio.Blocks(title="ChatGPT", css=css) as demo:
|
|
249 |
with gradio.Row():
|
250 |
with gradio.Column(scale=10):
|
251 |
chat_log = gradio.State()
|
252 |
-
with gradio.Box(
|
253 |
-
chat_log_box = gradio.Markdown(value="<center>(empty)</center>")
|
254 |
chat_copy_history_btn = gradio.Button("Copy all (as html currently)")
|
255 |
chat_copy_history_btn.click(
|
256 |
copy_history, inputs=[chat_log_box],
|
@@ -259,7 +259,7 @@ with gradio.Blocks(title="ChatGPT", css=css) as demo:
|
|
259 |
catch(error) {console?.log?.(error);};
|
260 |
}""",
|
261 |
)
|
262 |
-
chat_input_role = gradio.Dropdown(
|
263 |
chat_input = gradio.Textbox(lines=4, label='input')
|
264 |
with gradio.Row():
|
265 |
chat_clear_history_btn = gradio.Button("clear history")
|
|
|
164 |
def clear_history():
|
165 |
return [], ""
|
166 |
|
167 |
+
def copy_history(txt):
|
168 |
pass
|
169 |
|
170 |
|
|
|
249 |
with gradio.Row():
|
250 |
with gradio.Column(scale=10):
|
251 |
chat_log = gradio.State()
|
252 |
+
with gradio.Box():
|
253 |
+
chat_log_box = gradio.Markdown(label='chat history', value="<center>(empty)</center>")
|
254 |
chat_copy_history_btn = gradio.Button("Copy all (as html currently)")
|
255 |
chat_copy_history_btn.click(
|
256 |
copy_history, inputs=[chat_log_box],
|
|
|
259 |
catch(error) {console?.log?.(error);};
|
260 |
}""",
|
261 |
)
|
262 |
+
chat_input_role = gradio.Dropdown(label='role', choices=['user', 'system', 'assistant'], value='user')
|
263 |
chat_input = gradio.Textbox(lines=4, label='input')
|
264 |
with gradio.Row():
|
265 |
chat_clear_history_btn = gradio.Button("clear history")
|