Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,7 @@ def create_response(input_str,
|
|
65 |
return outputs
|
66 |
|
67 |
|
68 |
-
common_examples_string="
|
69 |
common_examples=[
|
70 |
["What is death?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The first example
|
71 |
["One of the best teachers in all of life turns out to be what?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The second example
|
@@ -86,12 +86,12 @@ interface_original = gr.Interface(fn=create_response,
|
|
86 |
# gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
|
87 |
# "likely ones (specified in num_beams)", value=7),
|
88 |
gr.Number(label="num_return_sequences (integer) the number of outputs selected from num_beams possible output",
|
89 |
-
value=
|
90 |
gr.Number(
|
91 |
label="temperature (decimal) controls the creativity or randomness of the output. A higher temperature" +
|
92 |
" (e.g., 0.9) results in more diverse and creative output, while a lower temperature (e.g., 0.2)" +
|
93 |
" makes the output more deterministic and focused",
|
94 |
-
value=
|
95 |
gr.Number(label="repetition_penalty (decimal) penalizes words that have already appeared in the output, " +
|
96 |
"making them less likely to be generated again. A higher repetition_penalty (e.g., 1.5) results" +
|
97 |
"in more varied and non-repetitive output.",
|
@@ -126,16 +126,16 @@ interface_untethered_model = gr.Interface(fn=create_response,
|
|
126 |
description="language model fine tuned with'The Untethered Soul' chapter 17"+common_examples_string,
|
127 |
#examples=examples,
|
128 |
inputs=[
|
129 |
-
|
130 |
# gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
|
131 |
# "likely ones (specified in num_beams)", value=7),
|
132 |
gr.Number(label="num_return_sequences (integer) the number of outputs selected from num_beams possible output",
|
133 |
-
value=
|
134 |
gr.Number(
|
135 |
label="temperature (decimal) controls the creativity or randomness of the output. A higher temperature" +
|
136 |
" (e.g., 0.9) results in more diverse and creative output, while a lower temperature (e.g., 0.2)" +
|
137 |
" makes the output more deterministic and focused",
|
138 |
-
value=
|
139 |
gr.Number(label="repetition_penalty (decimal) penalizes words that have already appeared in the output, " +
|
140 |
"making them less likely to be generated again. A higher repetition_penalty (e.g., 1.5) results" +
|
141 |
"in more varied and non-repetitive output.",
|
@@ -173,12 +173,12 @@ interface_untethered_paraphrased_model = gr.Interface(fn=create_response,
|
|
173 |
# gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
|
174 |
# "likely ones (specified in num_beams)", value=7),
|
175 |
gr.Number(label="num_return_sequences (integer) the number of outputs selected from num_beams possible output",
|
176 |
-
value=
|
177 |
gr.Number(
|
178 |
label="temperature (decimal) controls the creativity or randomness of the output. A higher temperature" +
|
179 |
" (e.g., 0.9) results in more diverse and creative output, while a lower temperature (e.g., 0.2)" +
|
180 |
" makes the output more deterministic and focused",
|
181 |
-
value=
|
182 |
gr.Number(label="repetition_penalty (decimal) penalizes words that have already appeared in the output, " +
|
183 |
"making them less likely to be generated again. A higher repetition_penalty (e.g., 1.5) results" +
|
184 |
"in more varied and non-repetitive output.",
|
|
|
65 |
return outputs
|
66 |
|
67 |
|
68 |
+
common_examples_string="<br/>Sample Inputs:\nWhat is death?\nOne of the best teachers in all of life turns out to be what?\nwhat is your most meaningful relationship?\nWhat actually gives life meaning?\n"
|
69 |
common_examples=[
|
70 |
["What is death?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The first example
|
71 |
["One of the best teachers in all of life turns out to be what?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The second example
|
|
|
86 |
# gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
|
87 |
# "likely ones (specified in num_beams)", value=7),
|
88 |
gr.Number(label="num_return_sequences (integer) the number of outputs selected from num_beams possible output",
|
89 |
+
value=default_num_return_sequences),
|
90 |
gr.Number(
|
91 |
label="temperature (decimal) controls the creativity or randomness of the output. A higher temperature" +
|
92 |
" (e.g., 0.9) results in more diverse and creative output, while a lower temperature (e.g., 0.2)" +
|
93 |
" makes the output more deterministic and focused",
|
94 |
+
value=default_temperature),
|
95 |
gr.Number(label="repetition_penalty (decimal) penalizes words that have already appeared in the output, " +
|
96 |
"making them less likely to be generated again. A higher repetition_penalty (e.g., 1.5) results" +
|
97 |
"in more varied and non-repetitive output.",
|
|
|
126 |
description="language model fine tuned with'The Untethered Soul' chapter 17"+common_examples_string,
|
127 |
#examples=examples,
|
128 |
inputs=[
|
129 |
+
gr.Textbox(label="input text here", lines=3),
|
130 |
# gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
|
131 |
# "likely ones (specified in num_beams)", value=7),
|
132 |
gr.Number(label="num_return_sequences (integer) the number of outputs selected from num_beams possible output",
|
133 |
+
value=default_num_return_sequences),
|
134 |
gr.Number(
|
135 |
label="temperature (decimal) controls the creativity or randomness of the output. A higher temperature" +
|
136 |
" (e.g., 0.9) results in more diverse and creative output, while a lower temperature (e.g., 0.2)" +
|
137 |
" makes the output more deterministic and focused",
|
138 |
+
value=default_temperature),
|
139 |
gr.Number(label="repetition_penalty (decimal) penalizes words that have already appeared in the output, " +
|
140 |
"making them less likely to be generated again. A higher repetition_penalty (e.g., 1.5) results" +
|
141 |
"in more varied and non-repetitive output.",
|
|
|
173 |
# gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
|
174 |
# "likely ones (specified in num_beams)", value=7),
|
175 |
gr.Number(label="num_return_sequences (integer) the number of outputs selected from num_beams possible output",
|
176 |
+
value=default_num_return_sequences),
|
177 |
gr.Number(
|
178 |
label="temperature (decimal) controls the creativity or randomness of the output. A higher temperature" +
|
179 |
" (e.g., 0.9) results in more diverse and creative output, while a lower temperature (e.g., 0.2)" +
|
180 |
" makes the output more deterministic and focused",
|
181 |
+
value=default_temperature),
|
182 |
gr.Number(label="repetition_penalty (decimal) penalizes words that have already appeared in the output, " +
|
183 |
"making them less likely to be generated again. A higher repetition_penalty (e.g., 1.5) results" +
|
184 |
"in more varied and non-repetitive output.",
|