diff options
author | Vika <vika@fireburn.ru> | 2024-09-04 19:49:26 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-09-04 19:51:50 +0300 |
commit | a26610044483ddd323479d748af401382b8df210 (patch) | |
tree | 94b6509723210dde2302774bc7e4d18be240ab41 /src/components/post_editor.rs | |
parent | 2ac75574d5ac87b194834348e52a2267be23ebcd (diff) | |
download | bowl-a26610044483ddd323479d748af401382b8df210.tar.zst |
Smart Summary is now working!
There's no preferences dialog, so you can't really adjust the prompt or the model it uses. The default settings work well for me. You may want to tweak them depending on your model preferences and compute budget. (Not many can afford to run Llama3-8B at high quantization. Conversely, you might have a better GPU than me and wish to run a 27B model or bigger.)
Diffstat (limited to 'src/components/post_editor.rs')
-rw-r--r-- | src/components/post_editor.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/components/post_editor.rs b/src/components/post_editor.rs index 8c81b6b..f2268ad 100644 --- a/src/components/post_editor.rs +++ b/src/components/post_editor.rs @@ -115,7 +115,7 @@ pub enum Input<E: std::error::Error + std::fmt::Debug + Send + 'static> { #[relm4::component(pub)] impl<E: std::error::Error + std::fmt::Debug + Send + 'static> Component for PostEditor<E> { - type Init = Option<Post>; + type Init = (<components::SmartSummaryButton as relm4::Component>::Init, Option<Post>); type Output = Option<Post>; type Input = Input<E>; type CommandOutput = (); @@ -330,7 +330,11 @@ impl<E: std::error::Error + std::fmt::Debug + Send + 'static> Component for Post } } - fn init(init: Self::Init, root: Self::Root, sender: ComponentSender<Self>) -> ComponentParts<Self> { + fn init( + (http, init): Self::Init, + root: Self::Root, + sender: ComponentSender<Self> + ) -> ComponentParts<Self> { let mut model = Self { smart_summary_busy_guard: None, sending: false, @@ -356,7 +360,7 @@ impl<E: std::error::Error + std::fmt::Debug + Send + 'static> Component for Post wide_layout: gtk::GridLayout::new(), smart_summary: components::SmartSummaryButton::builder() - .launch(()) + .launch(http) .forward(sender.input_sender(), Input::SmartSummary), tracker: Default::default(), |