Skip to content

Commit

Permalink
improve infilling script
Browse files Browse the repository at this point in the history
  • Loading branch information
andre15silva committed Nov 19, 2024
1 parent 4f918ca commit bafcd59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class GenerateSettings:
do_sample: bool = False
temperature: float = 1.0
num_beams: int = 1
early_stopping: bool = False
num_return_sequences: int = 10
max_length: int = 4096
early_stopping: bool = False


class CodeLLaMAInfilling(PatchGenerationStrategy):
Expand Down Expand Up @@ -119,6 +119,7 @@ def __generate_patch(self, prompt: str) -> Optional[List[str]]:
early_stopping=self.generate_settings.early_stopping,
do_sample=self.generate_settings.do_sample,
temperature=self.generate_settings.temperature,
use_cache=True,
)

fillings_ids = generated_ids[:, input_len:]
Expand Down
2 changes: 1 addition & 1 deletion generate_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def entry_point(
kwargs[key] = Path(kwargs[key]).name

kwargs_str = "_".join([f"{k}={v}" for k, v in kwargs.items()])
kwargs_str = kwargs_str.replace("/", ":")
kwargs_str = kwargs_str.replace("/", "-")
write_jsonl(
os.path.join(
dir_path,
Expand Down

0 comments on commit bafcd59

Please sign in to comment.