Spaces:
Build error
Build error
Commit ·
da1da84
1
Parent(s): 0dc341f
update
Browse files88 unmodified lines8990919293949 unmodified lines10410510610710810911088 unmodified linesrandom.seed(seed)all_samples = load_samples(method)selected_samples = select_balanced_samples(all_samples)random_string = generate_random_string()filename = f'{username}_{seed}_{method}_{random_string}.json'9 unmodified linesreturn "An error occurred", 500return render_template('index.html')@app.route('/experiment/<username>/<sample_index>/<seed>/<filename>', methods=['GET'])def experiment(username, sample_index, seed, filename):try:88 unmodified lines89909192939495969798999 unmodified lines10911011111211311488 unmodified linesrandom.seed(seed)all_samples = load_samples(method)selected_samples = select_balanced_samples(all_samples)logger.info(f"Number of selected samples: {len(selected_samples)}") # Log the number of samplesif len(selected_samples) == 0:logger.error("No samples were selected.")return "No samples were selected", 500random_string = generate_random_string()filename = f'{username}_{seed}_{method}_{random_string}.json'9 unmodified linesreturn "An error occurred", 500return render_template('index.html')@app.route('/experiment/<username>/<sample_index>/<seed>/<filename>', methods=['GET'])def experiment(username, sample_index, seed, filename):try:
app.py+5-1