Spaces:
Runtime error
Runtime error
fix: not accepting an empty generation
Browse files
app.py
CHANGED
@@ -72,6 +72,7 @@ def generate(
|
|
72 |
output = output.rstrip()
|
73 |
yield output
|
74 |
yield output
|
|
|
75 |
return output
|
76 |
|
77 |
|
@@ -123,7 +124,11 @@ CSS = """
|
|
123 |
p {direction: rtl; white-space: pre-line;}
|
124 |
"""
|
125 |
|
126 |
-
chatbot = gr.Chatbot(
|
|
|
|
|
|
|
|
|
127 |
textbox = gr.Textbox(
|
128 |
label="textbox",
|
129 |
container=False,
|
@@ -145,7 +150,7 @@ chat_interface = gr.ChatInterface(
|
|
145 |
def evolve_text(x):
|
146 |
|
147 |
possible_generation = "".join([x for x in generate(
|
148 |
-
x, "", additional_inputs[0].value,
|
149 |
temperature=additional_inputs[1].value,
|
150 |
max_new_tokens=10,
|
151 |
top_p=additional_inputs[3].value,
|
|
|
72 |
output = output.rstrip()
|
73 |
yield output
|
74 |
yield output
|
75 |
+
|
76 |
return output
|
77 |
|
78 |
|
|
|
124 |
p {direction: rtl; white-space: pre-line;}
|
125 |
"""
|
126 |
|
127 |
+
chatbot = gr.Chatbot(label="PersianGPT",
|
128 |
+
rtl=True,
|
129 |
+
show_share_button=True,
|
130 |
+
show_copy_button=True,
|
131 |
+
bubble_full_width = False)
|
132 |
textbox = gr.Textbox(
|
133 |
label="textbox",
|
134 |
container=False,
|
|
|
150 |
def evolve_text(x):
|
151 |
|
152 |
possible_generation = "".join([x for x in generate(
|
153 |
+
x if len(x)>0 else ">", "", additional_inputs[0].value,
|
154 |
temperature=additional_inputs[1].value,
|
155 |
max_new_tokens=10,
|
156 |
top_p=additional_inputs[3].value,
|