Skip to content

Commit

Permalink
fix: cargo fmt checks
Browse files Browse the repository at this point in the history
This commit attempts to fix the formatting issues that were found by
the format_check job.

Signed-off-by: Daniel Bevenius <[email protected]>
  • Loading branch information
danbev committed Oct 19, 2023
1 parent c50f2dc commit d651bad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions crates/llm-chain-local/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ fn model_params_from_options(opts: OptionsCascade) -> Result<ModelParameters, ()

fn inference_params_from_options(opts: OptionsCascade) -> Result<InferenceParameters, ()> {
let Some(Opt::NThreads(n_threads)) = opts.get(OptDiscriminants::NThreads) else {
return Err(())
return Err(());
};
let Some(Opt::NBatch(n_batch)) = opts.get(OptDiscriminants::NBatch) else {
return Err(())
return Err(());
};
let Some(Opt::TopK(top_k)) = opts.get(OptDiscriminants::TopK) else {
return Err(())
return Err(());
};
let Some(Opt::TopP(top_p)) = opts.get(OptDiscriminants::TopP) else {
return Err(());
Expand All @@ -225,7 +225,9 @@ fn inference_params_from_options(opts: OptionsCascade) -> Result<InferenceParame
return Err(());
};

let Some(Opt::RepeatPenaltyLastN(repetition_penalty_last_n)) = opts.get(OptDiscriminants::RepeatPenaltyLastN) else {
let Some(Opt::RepeatPenaltyLastN(repetition_penalty_last_n)) =
opts.get(OptDiscriminants::RepeatPenaltyLastN)
else {
return Err(());
};

Expand Down
2 changes: 1 addition & 1 deletion crates/llm-chain-openai/src/chatgpt/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ impl Executor {

fn get_model_from_invocation_options(&self, opts: &OptionsCascade) -> String {
let Some(Opt::Model(model)) = opts.get(llm_chain::options::OptDiscriminants::Model) else {
return "gpt-3.5-turbo".to_string()
return "gpt-3.5-turbo".to_string();
};
model.to_name()
}
Expand Down
2 changes: 1 addition & 1 deletion crates/llm-chain/src/chains/map_reduce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl Chain {
let mut current_doc = current.extract_last_body().cloned().unwrap_or_default();
while let Some(next) = v.last() {
let Some(next_doc_content) = next.extract_last_body() else {
continue
continue;
};
let mut new_doc = current_doc.clone();
new_doc.push('\n');
Expand Down
2 changes: 1 addition & 1 deletion crates/llm-chain/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> OptionsCascade<'a> {
/// Returns a boolean indicating if options indicate that requests should be streamed or not.
pub fn is_streaming(&self) -> bool {
let Some(Opt::Stream(val)) = self.get(OptDiscriminants::Stream) else {
return false
return false;
};
*val
}
Expand Down

0 comments on commit d651bad

Please sign in to comment.