From a26610044483ddd323479d748af401382b8df210 Mon Sep 17 00:00:00 2001 From: Vika Date: Wed, 4 Sep 2024 19:49:26 +0300 Subject: 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.) --- src/components/post_editor.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/components/post_editor.rs') 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 { #[relm4::component(pub)] impl Component for PostEditor { - type Init = Option; + type Init = (::Init, Option); type Output = Option; type Input = Input; type CommandOutput = (); @@ -330,7 +330,11 @@ impl Component for Post } } - fn init(init: Self::Init, root: Self::Root, sender: ComponentSender) -> ComponentParts { + fn init( + (http, init): Self::Init, + root: Self::Root, + sender: ComponentSender + ) -> ComponentParts { let mut model = Self { smart_summary_busy_guard: None, sending: false, @@ -356,7 +360,7 @@ impl 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(), -- cgit 1.4.1