fixed tfWorking
This commit is contained in:
parent
a4619c59d9
commit
c9a140900d
|
@ -112,10 +112,11 @@ def wtform():
|
||||||
|
|
||||||
tfWorking = -1
|
tfWorking = -1
|
||||||
|
|
||||||
try:
|
if tfWorking == -1:
|
||||||
|
try:
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
tfWorking = 1
|
tfWorking = 1
|
||||||
except:
|
except:
|
||||||
print("Could not load tensorflow model :/")
|
print("Could not load tensorflow model :/")
|
||||||
tfWorking = 0
|
tfWorking = 0
|
||||||
|
|
||||||
|
@ -141,11 +142,11 @@ def generate():
|
||||||
|
|
||||||
|
|
||||||
if request.method == 'POST' and form.validate_on_submit():
|
if request.method == 'POST' and form.validate_on_submit():
|
||||||
result = gen.sample(form.n.data)
|
|
||||||
print(tfWorking)
|
print(tfWorking)
|
||||||
if tfWorking == 0:
|
if tfWorking == 0:
|
||||||
flash("Failed to initialise the model!","danger")
|
flash("Failed to initialise the model!","danger")
|
||||||
else:
|
else:
|
||||||
|
result = gen.sample(form.n.data)
|
||||||
return render_template('generate.html',expName=j["exp_name"],epochs=j["num_epochs"],optimizer=j["optimizer"].capitalize(), form=form,result=result)
|
return render_template('generate.html',expName=j["exp_name"],epochs=j["num_epochs"],optimizer=j["optimizer"].capitalize(), form=form,result=result)
|
||||||
|
|
||||||
return render_template('generate.html',expName=j["exp_name"],epochs=j["num_epochs"],optimizer=j["optimizer"].capitalize(), form=form)
|
return render_template('generate.html',expName=j["exp_name"],epochs=j["num_epochs"],optimizer=j["optimizer"].capitalize(), form=form)
|
||||||
|
|
Loading…
Reference in New Issue