Skip to content

Commit

Permalink
remove add_author and add_title for OpenAI
Browse files Browse the repository at this point in the history
This is unsupported so the UI shouldn't show it.
  • Loading branch information
mdegans committed Jun 2, 2024
1 parent fa7ad74 commit 5dc6bb7
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/app/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,6 @@ impl Settings {
));
}

ui.checkbox(
&mut self.prompt_include_authors,
"Include author in prompt sent to model.",
)
.on_hover_text_at_pointer("It will still be shown in the viewport. Hiding it can improve quality of generation since models have biases. Does not apply to all backends.");

ui.checkbox(
&mut self.prompt_include_title,
"Include title in prompt sent to model.",
)
.on_hover_text_at_pointer("It will still be shown in the viewport. Hiding it can improve quality of generation since models have biases. Does not apply to all backends.");

// If there is only one backend, don't show the dropdown.
if GenerativeBackend::ALL.len() > 1 {
// allow the user to switch backends
Expand Down Expand Up @@ -287,6 +275,27 @@ impl Settings {
});
}

// Show the author and title options if the backend supports it. This is
// outside the match below because two mutable borrows of self are not
// allowed.
#[cfg(all(feature = "drama_llama", not(target_arch = "wasm32")))]
if matches!(
self.selected_generative_backend,
GenerativeBackend::DramaLlama
) {
ui.checkbox(
&mut self.prompt_include_authors,
"Include author in prompt sent to model.",
)
.on_hover_text_at_pointer("It will still be shown in the viewport. Hiding it can improve quality of generation since models have biases. Does not apply to all backends.");

ui.checkbox(
&mut self.prompt_include_title,
"Include title in prompt sent to model.",
)
.on_hover_text_at_pointer("It will still be shown in the viewport. Hiding it can improve quality of generation since models have biases. Does not apply to all backends.");
}

match self.backend_options() {
#[cfg(all(feature = "drama_llama", not(target_arch = "wasm32")))]
// FIXME: we should do like with `openai` below an have a settings
Expand Down

0 comments on commit 5dc6bb7

Please sign in to comment.