Spaces:
Runtime error
Runtime error
fix: use the additional_inputs for textbox_whoareu
Browse files
app.py
CHANGED
@@ -672,6 +672,11 @@ additional_inputs=[
|
|
672 |
interactive=True,
|
673 |
info="Penalize repeated tokens",
|
674 |
),
|
|
|
|
|
|
|
|
|
|
|
675 |
gr.Markdown(
|
676 |
"""
|
677 |
|
@@ -890,13 +895,7 @@ textbox = gr.Textbox(
|
|
890 |
rtl=True,
|
891 |
)
|
892 |
|
893 |
-
|
894 |
-
label="textbox_whoareu",
|
895 |
-
container=False,
|
896 |
-
show_label=False,
|
897 |
-
lines=1,
|
898 |
-
placeholder="...Please write your name here",
|
899 |
-
)
|
900 |
|
901 |
class ChatInterface(gr.ChatInterface):
|
902 |
def __init__(
|
@@ -1066,7 +1065,7 @@ def vote(data: gr.LikeData):
|
|
1066 |
{
|
1067 |
"time_stamp": time.time(),
|
1068 |
"model_version":MODEL_VERSION,
|
1069 |
-
"username":
|
1070 |
"prompt": PROMPT.replace('\n','؛').replace('\t','/').replace(' * ','/').replace('\u200c',' ').strip(),
|
1071 |
"system prompt": additional_inputs[0].value,
|
1072 |
"temperature": additional_inputs[1].value,
|
@@ -1107,7 +1106,7 @@ with gr.Blocks(css=CSS) as demo:
|
|
1107 |
with gr.Row():
|
1108 |
with gr.Column(css="""textarea {direction: ltl}
|
1109 |
p {direction: ltl}"""):
|
1110 |
-
|
1111 |
|
1112 |
# gr.Markdown().attach_load_event(hello, None)
|
1113 |
# with gr.Row():
|
|
|
672 |
interactive=True,
|
673 |
info="Penalize repeated tokens",
|
674 |
),
|
675 |
+
gr.Textbox(
|
676 |
+
"",
|
677 |
+
label="textbox_whoareu",
|
678 |
+
placeholder="...Please write your name here",
|
679 |
+
),
|
680 |
gr.Markdown(
|
681 |
"""
|
682 |
|
|
|
895 |
rtl=True,
|
896 |
)
|
897 |
|
898 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
899 |
|
900 |
class ChatInterface(gr.ChatInterface):
|
901 |
def __init__(
|
|
|
1065 |
{
|
1066 |
"time_stamp": time.time(),
|
1067 |
"model_version":MODEL_VERSION,
|
1068 |
+
"username":additional_inputs[-2].value,
|
1069 |
"prompt": PROMPT.replace('\n','؛').replace('\t','/').replace(' * ','/').replace('\u200c',' ').strip(),
|
1070 |
"system prompt": additional_inputs[0].value,
|
1071 |
"temperature": additional_inputs[1].value,
|
|
|
1106 |
with gr.Row():
|
1107 |
with gr.Column(css="""textarea {direction: ltl}
|
1108 |
p {direction: ltl}"""):
|
1109 |
+
additional_inputs[-2].render()
|
1110 |
|
1111 |
# gr.Markdown().attach_load_event(hello, None)
|
1112 |
# with gr.Row():
|