summarization

command
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

README

Summarization

Summarize text using a GGUF language model.

How it works

  1. Reads input text from --text, --file, or uses a built-in example
  2. Loads a GGUF model via inference.LoadFile
  3. Constructs a summarization prompt and generates a concise summary
  4. Prints the summary to stdout

Usage

go build -o summarization ./examples/summarization/

# Summarize inline text
./summarization --model path/to/model.gguf --text "Your long text here..."

# Summarize a file
./summarization --model path/to/model.gguf --file article.txt

# Use the built-in example
./summarization --model path/to/model.gguf

# With GPU acceleration
./summarization --model path/to/model.gguf --device cuda

Flags

Flag Default Description
--model (required) Path to GGUF model file
--device cpu Compute device: "cpu", "cuda"
--text (example) Inline text to summarize
--file Path to a text file to summarize
--max-tokens 256 Maximum tokens in the summary

Documentation

Overview

Command summarization demonstrates text summarization using a GGUF language model.

It reads text from a file or flag, prompts the model to produce a concise summary, and prints the result. Useful for condensing long documents, articles, or logs.

Usage:

go build -o summarization ./examples/summarization/
./summarization --model path/to/model.gguf --text "Long text to summarize..."
./summarization --model path/to/model.gguf --file article.txt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL