ierhon commited on
Commit
dba27fb
1 Parent(s): 87d2f85

Remove GradioDeprecationWarning

Browse files
Files changed (1) hide show
  1. 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 "Dataset example:\nquestion→answer\nquestion→answer\netc."
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.inputs.Slider(0, 0.01, default=0.0001, step=1e-8, label="Regularization L1"),
121
- gr.inputs.Slider(0, 0.5, default=0.1, step=1e-8, label="Dropout"),
122
- gr.inputs.Slider(1e-8, 0.01, default=0.001, step=1e-8, label="Learning rate"),
123
- gr.inputs.Slider(1, 64, default=32, step=1, label="Epochs"),
124
- gr.inputs.Slider(1, 256, default=88, step=1, label="Embedding size"),
125
- gr.inputs.Slider(1, 128, default=16, step=1, label="Input Length"),
126
- gr.inputs.Slider(1, 128, default=64, step=1, label="Convolution kernel count"),
127
- gr.inputs.Slider(1, 16, default=2, step=1, label="Convolution kernel size"),
128
- gr.inputs.Checkbox(False, label="Use left padding"),
129
- gr.inputs.Radio(['softmax', 'sigmoid', 'linear', 'softplus', 'exponential', 'log_softmax'], label="Output activation function"),
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()