Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Adds a way to specify the seed for RNG #36

Merged
merged 2 commits into from
Mar 18, 2023
Merged

Adds a way to specify the seed for RNG #36

merged 2 commits into from
Mar 18, 2023

Conversation

setzer22
Copy link
Collaborator

Implements #27 (at least the part we can implement, deterministic floating point math is out of scope for the project).

This allows specifying a --seed value in llama-cli. If no value is passed, the rng is seeded from system entropy like before.

Copy link
Collaborator

@philpax philpax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with no issues on my machine. Wow, that was easy!

@@ -2,7 +2,7 @@ use std::{convert::Infallible, io::Write};

use cli_args::CLI_ARGS;
use llama_rs::{InferenceParameters, InferenceSnapshot};
use rand::thread_rng;
use rand::{thread_rng, SeedableRng};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thread_rng is no longer used

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like CI's borked, it didn't catch this: https://github.com/setzer22/llama-rs/actions/runs/4455272439/jobs/7824987492?pr=36

Clippy emitted the warning, but the test didn't faill

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to add -Dwarnings to the clippy command

@setzer22 setzer22 merged commit 4a207f0 into main Mar 18, 2023
@philpax philpax deleted the feat/seed_rng branch July 16, 2023 19:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants