Spaces:
Sleeping
Sleeping
Commit ·
bb1f78e
1
Parent(s): 2534871
Update code generation to use string consensus thresholds
Browse filesGenerate cleaner code with string values like "majority" instead of 0.5.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
308 unmodified lines309310311312313314315308 unmodified linesmodels_str = '("gpt-4o", "auto", "YOUR_API_KEY"),\n ("claude-sonnet-4-5-20250929", "auto", "YOUR_API_KEY")'mode_param = f',\n mode="{mode}"' if mode and input_type == "pdf" else ''consensus_param = f',\n consensus_threshold={consensus_threshold} # {"Majority" if consensus_threshold == 0.5 else "Two-Thirds" if consensus_threshold == 0.67 else "Unanimous"}' if classify_mode == "Ensemble" else ''return f'''import catllm{load_data}308 unmodified lines309310311312313314315316317308 unmodified linesmodels_str = '("gpt-4o", "auto", "YOUR_API_KEY"),\n ("claude-sonnet-4-5-20250929", "auto", "YOUR_API_KEY")'mode_param = f',\n mode="{mode}"' if mode and input_type == "pdf" else ''# Map numeric threshold back to string for cleaner codethreshold_str = "majority" if consensus_threshold == 0.5 else "two-thirds" if consensus_threshold == 0.67 else "unanimous"consensus_param = f',\n consensus_threshold="{threshold_str}"' if classify_mode == "Ensemble" else ''return f'''import catllm{load_data}
app.py+3-1