Module: mellea.backends.aloras.huggingface.granite_aloras

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

Functions

mellea.backends.aloras.huggingface.granite_aloras.add_granite_aloras(backend: LocalHFBackend)

Adds the IBM Granite “starter pack” ALoras to a backend.

Classes

class mellea.backends.aloras.huggingface.granite_aloras.HFConstraintAlora(name: str, path_or_model_id: str, generation_prompt: str, backend: LocalHFBackend)

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

Constructor

Initialize after checking that the backend is correct.

Methods

mellea.backends.aloras.huggingface.granite_aloras.HFConstraintAlora.generate_using_strings(input: str, response: str, constraint: str, force_yn: bool = True)
Generates a constraint response from the ALora.
mellea.backends.aloras.huggingface.granite_aloras.HFConstraintAlora._generate_using_cache(cache_hit: HFAloraCacheInfo, constraint: str, force_yn: bool)

mellea.backends.aloras.huggingface.granite_aloras.HFConstraintAlora._generate_not_using_cache(input: str, response: str, constraint: str, force_yn: bool)