Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions crates/edit_prediction_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ impl Display for Command {
if args.context_only {
write!(f, " --context-only")?;
}
if args.related_context_limit != score::EVAL_RELATED_CONTEXT_TOKENS_LIMIT {
write!(f, " --related-context-limit={}", args.related_context_limit)?;
}
if let Some(provider) = &args.predict.provider {
write!(f, " --provider={}", provider)?;
}
Expand Down Expand Up @@ -334,6 +337,9 @@ struct EvalArgs {
/// Only compute editable context coverage from expected patches and retrieved context.
#[clap(long)]
context_only: bool,
/// Maximum number of retrieved context tokens to include when scoring.
#[clap(long, default_value_t = score::EVAL_RELATED_CONTEXT_TOKENS_LIMIT)]
related_context_limit: usize,
/// Path to write summary scores as JSON
#[clap(long)]
summary_json: Option<PathBuf>,
Expand Down Expand Up @@ -1303,7 +1309,7 @@ fn main() {
score::run_context_coverage_scoring(
example,
&example_progress,
Some(score::EVAL_RETRIEVED_CONTEXT_BYTE_LIMIT),
Some(args.related_context_limit * 3),
)?;
} else {
run_scoring(
Expand All @@ -1313,7 +1319,7 @@ fn main() {
&example_progress,
cx.clone(),
true,
Some(score::EVAL_RETRIEVED_CONTEXT_BYTE_LIMIT),
Some(args.related_context_limit * 3),
)
.await?;
}
Expand Down Expand Up @@ -1472,7 +1478,7 @@ fn main() {
&examples,
args.verbose,
args.context_only,
Some(score::EVAL_RETRIEVED_CONTEXT_BYTE_LIMIT),
Some(args.related_context_limit * 3),
);
if let Some(summary_path) = &args.summary_json {
score::write_summary_json(&examples, summary_path)?;
Expand Down
2 changes: 1 addition & 1 deletion crates/edit_prediction_cli/src/score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::io::BufWriter;
use std::path::Path;
use std::sync::Arc;

pub const EVAL_RETRIEVED_CONTEXT_BYTE_LIMIT: usize = 4000;
pub const EVAL_RELATED_CONTEXT_TOKENS_LIMIT: usize = 4000;

pub async fn run_scoring(
example: &mut Example,
Expand Down
Loading