Skip to content

Commit

Permalink
fix missing repo vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
zfj1998 committed May 3, 2024
1 parent cecce36 commit 6a6ef63
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions RepoCoder/run_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
from utils import CONSTANTS, CodexTokenizer

def make_repo_window(repos, window_sizes, slice_sizes):
worker = MakeWindowWrapper(None, repos, window_sizes, slice_sizes)
worker.window_for_repo_files()
MakeWindowWrapper(None, repos, window_sizes, slice_sizes).window_for_repo_files()
vectorizer = BagOfWords
BuildVectorWrapper(None, vectorizer, repos, window_sizes, slice_sizes).vectorize_repo_windows()


def run_RG1_and_oracle_method(benchmark, repos, window_sizes, slice_sizes):
# build code snippets for all the repositories
make_repo_window(repos, window_sizes, slice_sizes)
# build code snippets for vanilla retrieval-augmented approach and ground truth
MakeWindowWrapper(benchmark, repos, window_sizes, slice_sizes).window_for_baseline_and_ground()
# build vector for vanilla retrieval-augmented approach and ground truth
Expand Down Expand Up @@ -62,6 +61,9 @@ def run_RepoCoder_method(benchmark, repos, window_sizes, slice_sizes, prediction
window_sizes = [20]
slice_sizes = [2] # 20 / 2 = 10

# build window for the repos
make_repo_window(repos, window_sizes, slice_sizes)

# build prompt for the RG1 and oracle methods
run_RG1_and_oracle_method(CONSTANTS.api_benchmark, repos, window_sizes, slice_sizes)

Expand Down

0 comments on commit 6a6ef63

Please sign in to comment.