Skip to content

Commit

Permalink
Eval-V2-Modal: use segments.crossfile_context.text to compute code co…
Browse files Browse the repository at this point in the history
…mpletion
  • Loading branch information
moqimoqidea committed Jul 17, 2024
1 parent c4a7809 commit a86d0fe
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 24 deletions.
15 changes: 1 addition & 14 deletions python/tabby-eval/v2-modal/compute_code_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,23 +196,10 @@ def default_data_function(row):


def cross_file_data_function(row, prompt_template):
crossfile_context_list = row['segments.crossfile_context.list']
sorted_list = sorted(crossfile_context_list, key=lambda x: x['score'])
combined_context = ""

for item in sorted_list:
combined_context += f"// Path: {item['filename']}\n"
retrieved_chunk = item['retrieved_chunk']

for line in retrieved_chunk.split("\n"):
combined_context += f"// {line}\n"

logging.debug(f"Combined context in cross_file_data_function: {combined_context}")

return {
"debug_options": {
"raw_prompt": prompt_template.format(
prefix=combined_context + row['segments.prefix'],
prefix=row['segments.crossfile_context.text'] + row['segments.prefix'],
suffix=row['segments.suffix'])
}
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit a86d0fe

Please sign in to comment.