Curie-Web/app/templates/generate.html

43 lines
1.5 KiB
HTML
Raw Normal View History

2020-07-31 17:53:41 +01:00
{% extends 'base.html' %}
{% block main %}
<h1>Curie Generate</h1>
<p>The model {{expName}} has been trained for {{epochs}} epochs using the {{optimizer}} optimization algorithm</p>
<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) {
smilesDrawer.draw(tree, "canvas-{{x}}", "dark", false);
console.log(smilesDrawer.draw(tree, "canvas-{{x}}", "light", false))
});
</script>
{% endfor %}
2020-07-31 17:53:41 +01:00
{% endif %}
{% endblock %}