Skip to content

Commit fd371a1

Browse files
committed
fix llm
1 parent aa4965d commit fd371a1

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ venv.bak/
7070

7171
# Test models
7272
/sample_model/
73-
/test_model/
73+
/test_model*/
7474

7575
# Training data
7676
/programs

loda/llm/data_preprocessing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def create_training_examples(self, max_examples: int = -1) -> List[TrainingExamp
149149

150150
try:
151151
# Read the program file
152-
program_path = self.program_cache._get_path(program_id)
152+
program_path = self.program_cache.path(program_id)
153153
if not os.path.exists(program_path):
154154
continue
155155

@@ -171,12 +171,12 @@ def create_training_examples(self, max_examples: int = -1) -> List[TrainingExamp
171171

172172
# Validate that the code parses correctly
173173
try:
174-
Program.parse(clean_code)
174+
Program(clean_code)
175175
except Exception:
176176
continue # Skip programs that don't parse
177177

178178
example = TrainingExample(
179-
sequence_id=program_id,
179+
sequence_id=str(program_id),
180180
description=description,
181181
loda_code=clean_code,
182182
terms=terms
@@ -229,7 +229,7 @@ def augment_descriptions(self, examples: List[TrainingExample]) -> List[Training
229229
# Create new examples for each variation
230230
for variation in variations:
231231
augmented_example = TrainingExample(
232-
sequence_id=example.sequence_id + "_aug",
232+
sequence_id=str(example.sequence_id) + "_aug",
233233
description=variation,
234234
loda_code=example.loda_code,
235235
terms=example.terms

loda/llm/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _validate_and_evaluate_code(self, description: str, code: str) -> Generation
9898

9999
try:
100100
# Try to parse the program
101-
program = Program.parse(code)
101+
program = Program(code)
102102

103103
# Try to evaluate it for a few terms
104104
interpreter = Interpreter(max_memory=100, max_stack=10, max_steps=10000)

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ transformers>=4.20.0
99
datasets>=2.0.0
1010
tqdm>=4.62.0
1111
scikit-learn>=1.0.0
12+
sentencepiece>=0.1.95
13+
protobuf>=3.19.0

0 commit comments

Comments
 (0)