forked from enviPath/enviPy
Compare commits
1 Commits
d584791ee8
...
feature/le
| Author | SHA1 | Date | |
|---|---|---|---|
| 95d16690ef |
@ -955,6 +955,12 @@ def package_model(request, package_uuid, model_uuid):
|
||||
]
|
||||
dispatch(current_user, evaluate_model, current_model.pk, multigen, eval_package_ids)
|
||||
|
||||
return redirect(current_model.url)
|
||||
elif hidden == "retrain":
|
||||
from .tasks import dispatch, retrain
|
||||
|
||||
dispatch(current_user, retrain, current_model.pk)
|
||||
|
||||
return redirect(current_model.url)
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
@ -1,43 +1,55 @@
|
||||
<div class="modal fade" tabindex="-1" id="retrain_model_modal" role="dialog" aria-labelledby="retrain_model_modal"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Retrain Model</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="retrain_model_form" accept-charset="UTF-8" action="{{ meta.current_package.url }}/model"
|
||||
data-remote="true" method="post">
|
||||
<div class="jumbotron">
|
||||
To reflect changes in the rule or data packages, you can use the "Retrain" button,
|
||||
to let the model reflect the changes without creating a new model.
|
||||
While the model is retraining, it will be unavailable for prediction.
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="action" value="retrain">
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a id="retrain_model_form_submit" class="btn btn-primary" href="#">Retrain</a>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="modal fade"
|
||||
tabindex="-1"
|
||||
id="retrain_model_modal"
|
||||
role="dialog"
|
||||
aria-labelledby="retrain_model_modal"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
<span class="sr-only">Close</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Retrain Model</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form
|
||||
id="retrain_model_form"
|
||||
accept-charset="UTF-8"
|
||||
action="{{ meta.current_object.url }}"
|
||||
data-remote="true"
|
||||
method="post"
|
||||
>
|
||||
<div class="jumbotron">
|
||||
To reflect changes in the rule or data packages, you can use the
|
||||
"Retrain" button, to let the model reflect the changes without
|
||||
creating a new model. While the model is retraining, it will be
|
||||
unavailable for prediction.
|
||||
</div>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="hidden" value="retrain" />
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a id="retrain_model_form_submit" class="btn btn-primary" href="#"
|
||||
>Retrain</a
|
||||
>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
|
||||
$('#retrain_model_form_submit').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#retrain_model_form').submit();
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$("#retrain_model_form_submit").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$("#retrain_model_form").submit();
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user