Spaces:
Build error
Build error
Commit ·
678720e
1
Parent(s): ea1f759
update
Browse filesFiles changed (2)
152 unmodified lines15315415515615715816 unmodified lines175176177178179180181182183184185186187188189152 unmodified linesmethod = request.form.get('method')if not username or not seed or not method:return render_template('index.html', error="Please fill in all fields and select a method.")try:seed = int(seed)random.seed(seed)16 unmodified linessave_session_data(session_id, session_data)logger.info(f"Session data stored for user {username}, method {method}, session_id {session_id}")# Redirect based on the selected methodif method == 'No-XAI':return redirect(url_for('experiment', session_id=session_id))else:return redirect(url_for('explanation', session_id=session_id))except Exception as e:logger.exception(f"Error in index route: {e}")return render_template('index.html', error="An error occurred. Please try again.")return render_template('index.html')@app.route('/explanation/<session_id>')def explanation(session_id):152 unmodified lines15315415515615715815916016 unmodified lines177178179180181182183184185186187188152 unmodified linesmethod = request.form.get('method')if not username or not seed or not method:return render_template('index.html', error="Please fill in all fields and select a method.")if method not in ['Chain-of-Table', 'Plan-of-SQLs', 'Dater']:return render_template('index.html', error="Invalid method selected.")try:seed = int(seed)random.seed(seed)16 unmodified linessave_session_data(session_id, session_data)logger.info(f"Session data stored for user {username}, method {method}, session_id {session_id}")# Redirect to explanation for all methodsreturn redirect(url_for('explanation', session_id=session_id))except Exception as e:logger.exception(f"Error in index route: {e}")return render_template('index.html', error="An error occurred. Please try again.")return render_template('index.html', show_no_xai=False)@app.route('/explanation/<session_id>')def explanation(session_id):
207 unmodified lines208209210211212213207 unmodified lines<div class="method-button Dater" onclick="selectMethod('Dater')">Dater</div><div class="method-button No-XAI" onclick="selectMethod('No-XAI')">No-XAI</div>207 unmodified lines208209210211212213214207 unmodified lines<div class="method-button Dater" onclick="selectMethod('Dater')">Dater</div>{% if show_no_xai %}<div class="method-button No-XAI" onclick="selectMethod('No-XAI')">No-XAI</div>
app.py+5-6
templates/index.html+1