SFM2001 commited on
Commit
2b4f5e0
·
1 Parent(s): 9a14a03
Files changed (1) hide show
  1. views/infer.py +3 -1
views/infer.py CHANGED
@@ -36,6 +36,7 @@ def index():
36
  if request.method == 'POST':
37
  topic = request.form['topic'].strip()
38
  essay = request.form['essay'].strip()
 
39
  if not topic or not essay:
40
  flash('Please provide both a topic and an essay text.')
41
  return render_template('index.html', isempty='True')
@@ -45,6 +46,7 @@ def index():
45
  session['topic'] = topic
46
  session['essay'] = essay
47
  session['feedback'] = {}
 
48
  else:
49
  scores, feedback = generate_and_score_essay(
50
  topic, essay
@@ -68,7 +70,7 @@ def index():
68
  )
69
  db.session.add(new_history)
70
  db.session.commit()
71
-
72
  return redirect(url_for('infer.infer', token=token))
73
  print("FAILED TO INFER")
74
  return render_template('index.html', isempty='False', username=current_user.nickname if current_user.is_authenticated else '')
 
36
  if request.method == 'POST':
37
  topic = request.form['topic'].strip()
38
  essay = request.form['essay'].strip()
39
+ print("ESSAY TOPIC", essay, topic)
40
  if not topic or not essay:
41
  flash('Please provide both a topic and an essay text.')
42
  return render_template('index.html', isempty='True')
 
46
  session['topic'] = topic
47
  session['essay'] = essay
48
  session['feedback'] = {}
49
+ print("LESS THAN 20 WORDS")
50
  else:
51
  scores, feedback = generate_and_score_essay(
52
  topic, essay
 
70
  )
71
  db.session.add(new_history)
72
  db.session.commit()
73
+ print("REDIRECT TO INFER")
74
  return redirect(url_for('infer.infer', token=token))
75
  print("FAILED TO INFER")
76
  return render_template('index.html', isempty='False', username=current_user.nickname if current_user.is_authenticated else '')