Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -89,6 +89,8 @@ common_input_component_list = [
|
|
| 89 |
" select a word from the probability distribution at each step. This results in a more diverse and creative" +
|
| 90 |
" output, but it might also introduce errors and inconsistencies ", value=True)
|
| 91 |
]
|
|
|
|
|
|
|
| 92 |
common_output_component_list=[gr.Textbox(label="output response", lines=30)]
|
| 93 |
common_examples=[
|
| 94 |
["What is death?",5,0.2,1.5,0.9,True], # The first example
|
|
@@ -101,12 +103,14 @@ print(examples)
|
|
| 101 |
for example in examples:
|
| 102 |
example.append("original_model")
|
| 103 |
print(examples)
|
|
|
|
|
|
|
| 104 |
|
| 105 |
interface_original = gr.Interface(fn=create_response,
|
| 106 |
title="original",
|
| 107 |
description="original language model, no fine tuning",
|
| 108 |
examples=examples,
|
| 109 |
-
inputs=
|
| 110 |
outputs=common_output_component_list
|
| 111 |
)
|
| 112 |
examples = copy.deepcopy(common_examples)
|
|
@@ -114,11 +118,14 @@ print(examples)
|
|
| 114 |
for example in examples:
|
| 115 |
example.append("untethered_model")
|
| 116 |
print(examples)
|
|
|
|
|
|
|
|
|
|
| 117 |
interface_untethered_model = gr.Interface(fn=create_response,
|
| 118 |
title="untethered model",
|
| 119 |
description="language model fine tuned with'The Untethered Soul' chapter 17",
|
| 120 |
examples=examples,
|
| 121 |
-
inputs=
|
| 122 |
outputs=common_output_component_list
|
| 123 |
)
|
| 124 |
|
|
@@ -131,7 +138,7 @@ interface_untethered_model = gr.Interface(fn=create_response,
|
|
| 131 |
title="untethered paraphrased_model",
|
| 132 |
description="language model fine tuned with'The Untethered Soul' chapter 17 paraphrased",
|
| 133 |
examples=examples,
|
| 134 |
-
inputs=
|
| 135 |
outputs=common_output_component_list
|
| 136 |
)
|
| 137 |
|
|
|
|
| 89 |
" select a word from the probability distribution at each step. This results in a more diverse and creative" +
|
| 90 |
" output, but it might also introduce errors and inconsistencies ", value=True)
|
| 91 |
]
|
| 92 |
+
input_component_list=copy.deepcopy(common_input_component_list)
|
| 93 |
+
input_component_list.append(gr.Textbox(label="model", lines=3, value="original_model",visible=False))
|
| 94 |
common_output_component_list=[gr.Textbox(label="output response", lines=30)]
|
| 95 |
common_examples=[
|
| 96 |
["What is death?",5,0.2,1.5,0.9,True], # The first example
|
|
|
|
| 103 |
for example in examples:
|
| 104 |
example.append("original_model")
|
| 105 |
print(examples)
|
| 106 |
+
input_component_list=copy.deepcopy(common_input_component_list)
|
| 107 |
+
input_component_list.append(gr.Textbox(label="model", lines=3, value="untethered_model",visible=False))
|
| 108 |
|
| 109 |
interface_original = gr.Interface(fn=create_response,
|
| 110 |
title="original",
|
| 111 |
description="original language model, no fine tuning",
|
| 112 |
examples=examples,
|
| 113 |
+
inputs=input_component_list),
|
| 114 |
outputs=common_output_component_list
|
| 115 |
)
|
| 116 |
examples = copy.deepcopy(common_examples)
|
|
|
|
| 118 |
for example in examples:
|
| 119 |
example.append("untethered_model")
|
| 120 |
print(examples)
|
| 121 |
+
input_component_list=copy.deepcopy(common_input_component_list)
|
| 122 |
+
input_component_list.append(gr.Textbox(label="model", lines=3, value="untethered_paraphrased_model",visible=False))
|
| 123 |
+
|
| 124 |
interface_untethered_model = gr.Interface(fn=create_response,
|
| 125 |
title="untethered model",
|
| 126 |
description="language model fine tuned with'The Untethered Soul' chapter 17",
|
| 127 |
examples=examples,
|
| 128 |
+
inputs=input_component_list),
|
| 129 |
outputs=common_output_component_list
|
| 130 |
)
|
| 131 |
|
|
|
|
| 138 |
title="untethered paraphrased_model",
|
| 139 |
description="language model fine tuned with'The Untethered Soul' chapter 17 paraphrased",
|
| 140 |
examples=examples,
|
| 141 |
+
inputs=input_component_list),
|
| 142 |
outputs=common_output_component_list
|
| 143 |
)
|
| 144 |
|