Skip to content

Commit 46fd91b

Browse files
Update generative-proof-of-concept-CPU-preprocessing-in-memory.py
Add Phase I-b text generation samples and logging of phase I-b perplexity.
1 parent 6a8588c commit 46fd91b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

generative-proof-of-concept-CPU-preprocessing-in-memory.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,10 +1418,24 @@ def create_dataset(raw_text_samples, tokenizer, sample_expansion_batch_size=10)
14181418
pd.DataFrame(phase_i_b_history.history)
14191419
# To Do: Find best metric: Reference: cerebros/simplecerebrosrandomsearch/simple_cerebros_random_search.py: Line ~ 590
14201420
# = phase_i_b_history.
1421-
result = int(phase_i_b_history['perplexity'].min())
1421+
result_phase_i_b = int(phase_i_b_history['perplexity'].min())
1422+
mlflow.log_metric("phase_i_b-perplexity", result_phase_i_b)
14221423

1424+
# Text samples after Phase I-b training
1425+
counter = 0
1426+
for sample in prompt_samples:
1427+
test_text(
1428+
test_prompt=sample,
1429+
max_new_tokens=MAX_NEW_TOKENS,
1430+
sample_number=counter,
1431+
result_cutoff=RESULT_CUTOFF,
1432+
trial_id=trial_number,
1433+
test_sample_number=counter,
1434+
result_0=result_phase_i_b)
1435+
counter += 1
14231436

1424-
return result
1437+
return result_phase_i_b
1438+
14251439

14261440
def main():
14271441
# Optional fast path for CI / smoke tests

0 commit comments

Comments
 (0)