forked from enviPath/enviPy
Compare commits
1 Commits
fix/issue2
...
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)
|
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)
|
return redirect(current_model.url)
|
||||||
else:
|
else:
|
||||||
return HttpResponseBadRequest()
|
return HttpResponseBadRequest()
|
||||||
|
|||||||
@ -1,43 +1,55 @@
|
|||||||
<div class="modal fade" tabindex="-1" id="retrain_model_modal" role="dialog" aria-labelledby="retrain_model_modal"
|
<div
|
||||||
aria-hidden="true">
|
class="modal fade"
|
||||||
<div class="modal-dialog modal-lg">
|
tabindex="-1"
|
||||||
<div class="modal-content">
|
id="retrain_model_modal"
|
||||||
<div class="modal-header">
|
role="dialog"
|
||||||
<button type="button" class="close" data-dismiss="modal">
|
aria-labelledby="retrain_model_modal"
|
||||||
<span aria-hidden="true">×</span>
|
aria-hidden="true"
|
||||||
<span class="sr-only">Close</span>
|
>
|
||||||
</button>
|
<div class="modal-dialog modal-lg">
|
||||||
<h4 class="modal-title">Retrain Model</h4>
|
<div class="modal-content">
|
||||||
</div>
|
<div class="modal-header">
|
||||||
<div class="modal-body">
|
<button type="button" class="close" data-dismiss="modal">
|
||||||
<form id="retrain_model_form" accept-charset="UTF-8" action="{{ meta.current_package.url }}/model"
|
<span aria-hidden="true">×</span>
|
||||||
data-remote="true" method="post">
|
<span class="sr-only">Close</span>
|
||||||
<div class="jumbotron">
|
</button>
|
||||||
To reflect changes in the rule or data packages, you can use the "Retrain" button,
|
<h4 class="modal-title">Retrain Model</h4>
|
||||||
to let the model reflect the changes without creating a new model.
|
</div>
|
||||||
While the model is retraining, it will be unavailable for prediction.
|
<div class="modal-body">
|
||||||
</div>
|
<form
|
||||||
{% csrf_token %}
|
id="retrain_model_form"
|
||||||
<input type="hidden" name="action" value="retrain">
|
accept-charset="UTF-8"
|
||||||
</form>
|
action="{{ meta.current_object.url }}"
|
||||||
</div>
|
data-remote="true"
|
||||||
<div class="modal-footer">
|
method="post"
|
||||||
<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 class="jumbotron">
|
||||||
</div>
|
To reflect changes in the rule or data packages, you can use the
|
||||||
</div>
|
"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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
$(function () {
|
||||||
$(function () {
|
$("#retrain_model_form_submit").on("click", function (e) {
|
||||||
|
e.preventDefault();
|
||||||
$('#retrain_model_form_submit').on('click', function (e) {
|
$("#retrain_model_form").submit();
|
||||||
e.preventDefault();
|
|
||||||
$('#retrain_model_form').submit();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user