diff --git a/ReadMe.md b/ReadMe.md index 1bf832f..9d89be0 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -31,7 +31,8 @@ output.) ``` The above are the default settings. If you need something different, you only -need to specify the changes. +need to specify the changes. (There is a `config.json.example` file equivalent +to the above.) ### Gemini Issues None of this works unless you **disable Gemini's personalization/memory**, diff --git a/config.json.example b/config.json.example index cc22bbc..df371d6 100644 --- a/config.json.example +++ b/config.json.example @@ -1,5 +1,7 @@ { "llm_covers": { - "calibre_location": "/Applications/calibre.app" + "calibre_location": "/Applications/calibre.app", + "default_model": "gemma4:12b-mlx", + "maximum_bytes": 40000 } } diff --git a/lib/timing.lua b/lib/timing.lua index e770603..96ece80 100644 --- a/lib/timing.lua +++ b/lib/timing.lua @@ -18,6 +18,8 @@ function timing.stop() end function timing.print_report() + if #entries == 0 then return end + local minimum, maximum, sum = math.huge, -math.huge, 0 for _, data in pairs(entries) do local delta = data.delta diff --git a/make_cover_briefs.lua b/make_cover_briefs.lua index 1b4279b..40803f5 100755 --- a/make_cover_briefs.lua +++ b/make_cover_briefs.lua @@ -52,8 +52,8 @@ local send_prompt = function(text, model) timing.start() -- word wrap breaks the raw output badly, so I need to implement my own for terminal output somehow - local output = utility.capture_safe("cat " .. tmp_file_name:enquote() .. " | ollama run " .. (model or default_model) .. " --nowordwrap") - os.execute("ollama stop " .. (model or default_model)) -- NOTE this makes things slower, but more stable + local output = utility.capture_safe("cat " .. tmp_file_name:enquote() .. " | ollama run " .. (model or config.llm_covers.default_model) .. " --nowordwrap") + os.execute("ollama stop " .. (model or config.llm_covers.default_model)) -- NOTE this makes things slower, but more stable local delta = timing.stop() print("Took " .. delta .. " minutes.") @@ -165,6 +165,7 @@ local convert_ebooks = function(books) if utility.path_exists(extracted_file) then data.extracted_file = extracted_file + data.extracted_file_size = utility.file_size(extracted_file) end end end