Spaces:
Runtime error
Runtime error
faisalhr1997
commited on
Commit
•
369bb24
1
Parent(s):
c57b026
Update app.py
Browse files
app.py
CHANGED
@@ -108,35 +108,35 @@ def chat():
|
|
108 |
instructions = gr.Textbox(
|
109 |
placeholder="LLM instructions",
|
110 |
value=DEFAULT_INSTRUCTIONS,
|
111 |
-
lines=
|
112 |
interactive=True,
|
113 |
label="Instructions",
|
114 |
-
max_lines=
|
115 |
-
show_label=False,
|
116 |
-
)
|
117 |
-
with gr.Accordion("Role #1", open=False):
|
118 |
-
instructions = gr.Textbox(
|
119 |
-
placeholder="Role #1 like ### Instruction",
|
120 |
-
value=USER_NAME,
|
121 |
-
lines=1,
|
122 |
-
interactive=True,
|
123 |
-
label="Role #1",
|
124 |
-
max_lines=1,
|
125 |
-
show_label=False,
|
126 |
-
)
|
127 |
-
with gr.Accordion("Role #2", open=False):
|
128 |
-
instructions = gr.Textbox(
|
129 |
-
placeholder="Role #2 like ### Response",
|
130 |
-
value=BOT_NAME,
|
131 |
-
lines=1,
|
132 |
-
interactive=True,
|
133 |
-
label="Role #2",
|
134 |
-
max_lines=1,
|
135 |
show_label=False,
|
136 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
|
138 |
def run_chat(
|
139 |
-
message: str, chat_history, instructions: str,
|
140 |
):
|
141 |
if not message or (message == RETRY_COMMAND and len(chat_history) == 0):
|
142 |
yield chat_history
|
@@ -151,7 +151,7 @@ def chat():
|
|
151 |
chat_history = chat_history + [[message, ""]]
|
152 |
stream = llm(
|
153 |
prompt,
|
154 |
-
max_new_tokens=
|
155 |
stop=[STOP_STR, "<|endoftext|>"],
|
156 |
temperature=temperature,
|
157 |
top_p=top_p,
|
|
|
108 |
instructions = gr.Textbox(
|
109 |
placeholder="LLM instructions",
|
110 |
value=DEFAULT_INSTRUCTIONS,
|
111 |
+
lines=3,
|
112 |
interactive=True,
|
113 |
label="Instructions",
|
114 |
+
max_lines=10,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
show_label=False,
|
116 |
)
|
117 |
+
# with gr.Accordion("Role #1", open=False):
|
118 |
+
# instructions = gr.Textbox(
|
119 |
+
# placeholder="Role #1 like ### Instruction",
|
120 |
+
# value=USER_NAME,
|
121 |
+
# lines=1,
|
122 |
+
# interactive=True,
|
123 |
+
# label="USER_NAME",
|
124 |
+
# max_lines=1,
|
125 |
+
# show_label=False,
|
126 |
+
# )
|
127 |
+
# with gr.Accordion("Role #2", open=False):
|
128 |
+
# instructions = gr.Textbox(
|
129 |
+
# placeholder="Role #2 like ### Response",
|
130 |
+
# value=BOT_NAME,
|
131 |
+
# lines=1,
|
132 |
+
# interactive=True,
|
133 |
+
# label="BOT_NAME",
|
134 |
+
# max_lines=1,
|
135 |
+
# show_label=False,
|
136 |
+
# )
|
137 |
|
138 |
def run_chat(
|
139 |
+
message: str, chat_history, instructions: str, temperature: float, top_p: float
|
140 |
):
|
141 |
if not message or (message == RETRY_COMMAND and len(chat_history) == 0):
|
142 |
yield chat_history
|
|
|
151 |
chat_history = chat_history + [[message, ""]]
|
152 |
stream = llm(
|
153 |
prompt,
|
154 |
+
max_new_tokens=1024,
|
155 |
stop=[STOP_STR, "<|endoftext|>"],
|
156 |
temperature=temperature,
|
157 |
top_p=top_p,
|