fix: remove hard-coded absolute paths from evaluator#113
Open
AaryanCode69 wants to merge 1 commit intoreactome:mainfrom
Open
fix: remove hard-coded absolute paths from evaluator#113AaryanCode69 wants to merge 1 commit intoreactome:mainfrom
AaryanCode69 wants to merge 1 commit intoreactome:mainfrom
Conversation
The evaluator script contained two hard-coded absolute paths pointing to a specific developer's local machine, making it impossible to run on other machines, in CI, or inside Docker containers. - Add --embeddings_dir and --csv_path CLI arguments for explicit control - Fall back to EmbeddingEnvironment.get_dir() for zero-config usage - Add _resolve_paths() helper with existence validation - Remove all absolute path references from the file Resolves reactome#109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove hard-coded absolute paths from the evaluation script and make them configurable via CLI arguments, with automatic fallback to the project's existing
EmbeddingEnvironmentresolver.Problem
src/evaluation/evaluator.pycontained two hard-coded absolute paths pointing to a specific developer's local machine:This made it impossible to:
Solution
Replace the hard-coded paths with two new CLI arguments that integrate with the project's existing
EmbeddingEnvironmentutility:Path Resolution Logic
Changes
src/evaluation/evaluator.py--embeddings_dirand--csv_pathCLI args; added_resolve_paths()helper withEmbeddingEnvironmentfallback and existence validation; updatedinitialize_rag_chain_with_memory()signature to acceptcsv_pathDesign Decisions
argparseinterface (--testset_dir,--model,--rag_type) and the companiontest_generator.pywhich also usesargparse.EmbeddingEnvironment— reuses the project's existing path resolution utility (src/util/embedding_environment.py) rather than inventing a new mechanism. This is the same resolver used by the main application at runtime.embeddings_manager use, while CI and Docker can pass explicit paths._resolve_paths()raisesFileNotFoundErrorwith a clear message before any expensive initialization runs.Backward Compatibility
--embeddings_dirand--csv_pathare provided matching the old hard-coded values.Related Issue
Resolves #109