Spaces:
Build error
Build error
Commit ·
09a6458
1
Parent(s): 7003a4e
update
Browse files67 unmodified lines6869707172737427 unmodified lines10210310410410510610710 unmodified lines11811912012112212312412112212312467 unmodified linesdef generate_random_string(length=8): return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
@app.route('/', methods=['GET', 'POST'])def index(): logger.info("Rendering index page.")27 unmodified lines
session['responses'] = [] # Initialize responses list session['method'] = method # Store the selected method logger.info(f"Method stored in session: {session['method']}")
return redirect(url_for('experiment', username=username, sample_index=0, seed=seed, filename=filename)) except Exception as e:10 unmodified lines with open(f'session_data/{filename}', 'r') as f: selected_samples = json.load(f)
method = session.get('method') if not method: logger.error(f"Method not found in session. Session contents: {session.items()}") return "Method not found", 500 method = session.get('method') # Retrieve the selected method
if sample_index >= len(selected_samples): logger.error(f"Sample index {sample_index} exceeds the number of selected samples {len(selected_samples)}.")app.py+2-5