2020-07-31 17:53:41 +01:00
|
|
|
{% extends 'base.html' %}
|
2020-09-16 19:21:21 +01:00
|
|
|
{% set active_page = "generate" %}
|
2020-07-31 17:53:41 +01:00
|
|
|
{% block main %}
|
|
|
|
<h1>Curie Generate</h1>
|
2020-08-25 19:00:44 +01:00
|
|
|
<p>The model {{expName}} has been trained for {{epochs}} epochs using the {{optimizer}} optimization algorithm. Option for finetuning coming soon.</p>
|
2020-07-31 17:53:41 +01:00
|
|
|
<form action="{{ url_for('generate') }}" method="post" enctype="multipart/form-data">
|
|
|
|
{% include 'flash_messages.html' %}
|
|
|
|
{{ form.csrf_token }}
|
|
|
|
<div class="form-row">
|
|
|
|
{{ form.n.label }}
|
|
|
|
{{ form.n(class="form-control")}}
|
|
|
|
</div>
|
2020-08-06 07:46:50 +01:00
|
|
|
<!--<div class="form-row">
|
|
|
|
{\{ form.modelSelection.label }}
|
|
|
|
{\{ form.modelSelection(class="form-control")}}
|
|
|
|
</div>-->
|
2020-07-31 17:53:41 +01:00
|
|
|
<br>
|
|
|
|
<div class="form-row">
|
|
|
|
<button type="submit" class="btn btn-primary">Submit</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if result %}
|
2020-08-06 07:46:50 +01:00
|
|
|
</b>Generated Compounds</b>
|
|
|
|
<script src="https://unpkg.com/smiles-drawer@1.0.10/dist/smiles-drawer.min.js"></script>
|
|
|
|
<script>
|
|
|
|
let options = {};
|
|
|
|
let smilesDrawer = new SmilesDrawer.Drawer(options);
|
|
|
|
</script>
|
|
|
|
{% for x in range(result|length) %}
|
|
|
|
<!--<i>{\{result}}</i>-->
|
|
|
|
<p>{{result[x]}}</p>
|
|
|
|
<canvas id="canvas-{{x}}" width="500" height="500"></canvas>
|
|
|
|
<script>
|
|
|
|
SmilesDrawer.parse('{{result[0]}}', function(tree) {
|
2020-09-24 11:41:43 +01:00
|
|
|
smilesDrawer.draw(tree, "canvas-{{x}}", "light", false);
|
|
|
|
console.log(smilesDrawer.draw(tree, "canvas-{{x}}", "light", false))
|
2020-08-06 07:46:50 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endfor %}
|
2020-07-31 17:53:41 +01:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% endblock %}
|