Skip to main content

mellea.backends.aloras.huggingface.granite_aloras

Huggingface implementations for IBM’s “starter pack” of Activated LoRAs.

Functions

processing

processing(mot: ModelOutputThunk, chunk: GenerateDecoderOnlyOutput, backend: LocalHFBackend, force_yn: bool, gen_prompt: str)
Called to process the incoming chunks.

post_processing

post_processing(mot: ModelOutputThunk, backend: LocalHFBackend)
Called after all data has been received.

add_granite_aloras

add_granite_aloras(backend: LocalHFBackend)
Adds the IBM Granite “starter pack” ALoras to a backend.

Classes

HFConstraintAlora

The Requirement Checking ALora for Granite checks if the specified requirement was satisfied by the most recent model generation. Only one requirement is checked at a time. Currently supports Granite 3.2 8B and Granite 3.3 8B by default. Methods:

generate_using_strings

generate_using_strings(self, input: str, response: str, constraint: str, force_yn: bool = True, stream: bool = False) -> ModelOutputThunk
Generates a constraint response from the ALora. Must be run in a running event loop.
I