mirror of
https://github.com/TabbyML/tabby
synced 2024-11-21 16:03:07 +00:00
Eval-V2-Modal: use segments.crossfile_context.text to compute code completion
This commit is contained in:
parent
c4a78099f7
commit
a86d0feeb9
@ -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'])
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user