Spaces:
Runtime error
Runtime error
feat: use the panel layout instead of bubble
Browse files
app.py
CHANGED
|
@@ -154,7 +154,7 @@ def generate(
|
|
| 154 |
else:
|
| 155 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=True, return_full_text=False)
|
| 156 |
|
| 157 |
-
output = ""
|
| 158 |
for response in stream:
|
| 159 |
#print('stream',response)
|
| 160 |
|
|
@@ -230,7 +230,9 @@ chatbot = gr.Chatbot(label="PersianGPT",
|
|
| 230 |
rtl=True,
|
| 231 |
show_share_button=True,
|
| 232 |
show_copy_button=True,
|
|
|
|
| 233 |
bubble_full_width = False)
|
|
|
|
| 234 |
textbox = gr.Textbox(
|
| 235 |
label="textbox",
|
| 236 |
container=False,
|
|
@@ -265,18 +267,18 @@ chat_interface = gr.ChatInterface(
|
|
| 265 |
|
| 266 |
#print(dir(chat_interface))
|
| 267 |
|
| 268 |
-
def evolve_text(x):
|
| 269 |
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
|
| 281 |
def vote(data: gr.LikeData):
|
| 282 |
if data.liked:
|
|
|
|
| 154 |
else:
|
| 155 |
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=False, details=True, return_full_text=False)
|
| 156 |
|
| 157 |
+
output = f"{prompt}"
|
| 158 |
for response in stream:
|
| 159 |
#print('stream',response)
|
| 160 |
|
|
|
|
| 230 |
rtl=True,
|
| 231 |
show_share_button=True,
|
| 232 |
show_copy_button=True,
|
| 233 |
+
layout="panel",
|
| 234 |
bubble_full_width = False)
|
| 235 |
+
|
| 236 |
textbox = gr.Textbox(
|
| 237 |
label="textbox",
|
| 238 |
container=False,
|
|
|
|
| 267 |
|
| 268 |
#print(dir(chat_interface))
|
| 269 |
|
| 270 |
+
# def evolve_text(x):
|
| 271 |
|
| 272 |
+
# possible_generation = "".join([x for x in generate(
|
| 273 |
+
# x if len(x)>0 else "@", HISTORY, additional_inputs[0].value,
|
| 274 |
+
# temperature=additional_inputs[1].value,
|
| 275 |
+
# max_new_tokens=10,
|
| 276 |
+
# top_p=additional_inputs[3].value,
|
| 277 |
+
# repetition_penalty=additional_inputs[4].value,
|
| 278 |
+
# #seed=42,
|
| 279 |
+
# )][-1]) #TODO: need a smarter way to do this
|
| 280 |
+
|
| 281 |
+
# return possible_generation
|
| 282 |
|
| 283 |
def vote(data: gr.LikeData):
|
| 284 |
if data.liked:
|