Spaces:
Sleeping
Sleeping
Remove GradioDeprecationWarning
Browse files- chatbot_constructor.py +11 -11
chatbot_constructor.py
CHANGED
@@ -38,7 +38,7 @@ def train(message: str = "", regularization: float = 0.0001, dropout: float = 0.
|
|
38 |
if data in os.listdir("cache"): # data = filename
|
39 |
data_hash = data # set the hash to the file name
|
40 |
else:
|
41 |
-
return "
|
42 |
dset, responses = todset(data)
|
43 |
resps_len = len(responses)
|
44 |
tokenizer = Tokenizer()
|
@@ -117,16 +117,16 @@ def train(message: str = "", regularization: float = 0.0001, dropout: float = 0.
|
|
117 |
|
118 |
if __name__ == "__main__":
|
119 |
iface = gr.Interface(fn=train, inputs=["text",
|
120 |
-
gr.
|
121 |
-
gr.
|
122 |
-
gr.
|
123 |
-
gr.
|
124 |
-
gr.
|
125 |
-
gr.
|
126 |
-
gr.
|
127 |
-
gr.
|
128 |
-
gr.
|
129 |
-
gr.
|
130 |
"text"],
|
131 |
outputs="text")
|
132 |
iface.launch()
|
|
|
38 |
if data in os.listdir("cache"): # data = filename
|
39 |
data_hash = data # set the hash to the file name
|
40 |
else:
|
41 |
+
return "Data example:\nquestion→answer\nquestion→answer\netc."
|
42 |
dset, responses = todset(data)
|
43 |
resps_len = len(responses)
|
44 |
tokenizer = Tokenizer()
|
|
|
117 |
|
118 |
if __name__ == "__main__":
|
119 |
iface = gr.Interface(fn=train, inputs=["text",
|
120 |
+
gr.components.Slider(0, 0.01, default=0.0001, step=1e-8, label="Regularization L1"),
|
121 |
+
gr.components.Slider(0, 0.5, default=0.1, step=1e-8, label="Dropout"),
|
122 |
+
gr.components.Slider(1e-8, 0.01, default=0.001, step=1e-8, label="Learning rate"),
|
123 |
+
gr.components.Slider(1, 64, default=32, step=1, label="Epochs"),
|
124 |
+
gr.components.Slider(1, 256, default=88, step=1, label="Embedding size"),
|
125 |
+
gr.components.Slider(1, 128, default=16, step=1, label="Input Length"),
|
126 |
+
gr.components.Slider(1, 128, default=64, step=1, label="Convolution kernel count"),
|
127 |
+
gr.components.Slider(1, 16, default=2, step=1, label="Convolution kernel size"),
|
128 |
+
gr.components.Checkbox(False, label="Use left padding"),
|
129 |
+
gr.components.Radio(['softmax', 'sigmoid', 'linear', 'softplus', 'exponential', 'log_softmax'], label="Output activation function"),
|
130 |
"text"],
|
131 |
outputs="text")
|
132 |
iface.launch()
|