feat: Improve patch formatting and handle empty data in pr_code_suggestions.py

This commit is contained in:
mrT23
2024-01-29 22:00:11 +02:00
parent 0d86779799
commit 15c8fe94bb
2 changed files with 11 additions and 1 deletions

View File

@ -226,7 +226,7 @@ class PRCodeSuggestions:
for i, patches_diff in enumerate(patches_diff_list):
get_logger().info(f"Processing chunk {i + 1} of {len(patches_diff_list)}")
self.patches_diff = patches_diff
prediction = await self._get_prediction(model)
prediction = await self._get_prediction(model) # toDo: parallelize
prediction_list.append(prediction)
self.prediction_list = prediction_list
@ -259,6 +259,9 @@ class PRCodeSuggestions:
suggestion_list.append(suggestion)
data_sorted = [[]] * len(suggestion_list)
if len(suggestion_list ) == 1:
return suggestion_list
try:
suggestion_str = ""
for i, suggestion in enumerate(suggestion_list):