Spaces:
Sleeping
Sleeping
Add if __name__ == "__main__"
Browse filesAfter using git clone now chatbot_constructor.py can be imported
- app.py → constructor.py +9 -8
app.py → constructor.py
RENAMED
@@ -71,11 +71,12 @@ def train(message: str, epochs: int, learning_rate: float, emb_size: int, inp_le
|
|
71 |
keras.backend.clear_session()
|
72 |
return responses[np.argmax(prediction)]
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
71 |
keras.backend.clear_session()
|
72 |
return responses[np.argmax(prediction)]
|
73 |
|
74 |
+
if __name__ == "__main__":
|
75 |
+
iface = gr.Interface(fn=train, inputs=["text",
|
76 |
+
gr.inputs.Slider(1, 64, default=32, step=1, label="Epochs"),
|
77 |
+
gr.inputs.Slider(0.00000001, 0.1, default=0.001, step=0.00000001, label="Learning rate"),
|
78 |
+
gr.inputs.Slider(1, 256, default=100, step=1, label="Embedding size"),
|
79 |
+
gr.inputs.Slider(1, 128, default=16, step=1, label="Input Length"),
|
80 |
+
"text"],
|
81 |
+
outputs="text")
|
82 |
+
iface.launch()
|