Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ def format_prompt(message, history):
|
|
19 |
|
20 |
def chat_inf(system_prompt,prompt,history):
|
21 |
if not history:
|
22 |
-
history =
|
23 |
|
24 |
seed = random.randint(1,1111111111111111)
|
25 |
generate_kwargs = dict(
|
@@ -66,18 +66,20 @@ chat=[('user','bot'),('user','bot')]
|
|
66 |
with gr.Blocks() as app:
|
67 |
with gr.Row():
|
68 |
with gr.Column(scale=3):
|
69 |
-
|
70 |
-
|
71 |
-
with gr.
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
78 |
with gr.Column(scale=1):
|
79 |
with gr.Group():
|
80 |
-
sys_inp = gr.Textbox(label="System Prompt")
|
81 |
im_btn=gr.Button("Screenshot")
|
82 |
img=gr.Image(type='filepath')
|
83 |
btn.click(chat_inf,[sys_inp,inp,chat_b],chat_b)
|
|
|
19 |
|
20 |
def chat_inf(system_prompt,prompt,history):
|
21 |
if not history:
|
22 |
+
history = ("","")
|
23 |
|
24 |
seed = random.randint(1,1111111111111111)
|
25 |
generate_kwargs = dict(
|
|
|
66 |
with gr.Blocks() as app:
|
67 |
with gr.Row():
|
68 |
with gr.Column(scale=3):
|
69 |
+
with gr.Group():
|
70 |
+
chat_b = gr.Chatbot()
|
71 |
+
with gr.Row():
|
72 |
+
with gr.Column(scale=3):
|
73 |
+
inp = gr.Textbox(label="Prompt")
|
74 |
+
sys_inp = gr.Textbox(label="System Prompt (optional)")
|
75 |
+
btn = gr.Button("Chat")
|
76 |
+
|
77 |
+
with gr.Column(scale=1):
|
78 |
+
with gr.Group():
|
79 |
+
stop_btn=gr.Button("Stop")
|
80 |
+
clear_btn=gr.Button("Clear")
|
81 |
with gr.Column(scale=1):
|
82 |
with gr.Group():
|
|
|
83 |
im_btn=gr.Button("Screenshot")
|
84 |
img=gr.Image(type='filepath')
|
85 |
btn.click(chat_inf,[sys_inp,inp,chat_b],chat_b)
|