CoolFace
Apppublic

ealharbi/crystallography-assistant

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes
App README

Crystallography assistant

Language models fine-tuned on confirmed question-and-answer pairs from four macromolecular crystallography mailing lists: CCP4BB, CCP-EM, phenixbb and the COOT list.

Choosing a model

The dropdown lists every variant an adapter has been configured for. Small models (7B/8B) answer in a few seconds on a modest GPU; the large variants (70B–123B) need a correspondingly large Space, and switching between sizes reloads weights, so the first question after a change is slower.

Configuration

Set these under Settings → Variables and secrets. Only the variants you configure appear in the dropdown.

VariableModel
ADAPTER_MISTRAL_7BMistral-7B-Instruct-v0.3
ADAPTER_QWEN_7BQwen2.5-7B-Instruct
ADAPTER_LLAMA_8BMeta-Llama-3-8B-Instruct
ADAPTER_MISTRAL_123BMistral-Large-Instruct-2407
ADAPTER_QWEN_72BQwen2.5-72B-Instruct
ADAPTER_LLAMA_70BMeta-Llama-3-70B-Instruct

Additional settings:

VariableMeaningDefault
DEFAULT_MODELSelection on loadMistral 7B (recommended)
INDEX_DIRRetrieval index directoryindex_docs
LOAD_IN_4BIT4-bit quantisation, for fitting large modelsunset

Hardware

ZeroGPU is the practical choice: a GPU is allocated per request and released afterwards, so an idle Space costs nothing. Generation is wrapped in @spaces.GPU with a 240-second window, which has to cover loading the weights on a cold start as well as producing the answer.

Only the 7B/8B variants are realistic on ZeroGPU. The 70B and 123B variants need 140–246 GB of dedicated accelerator memory, or LOAD_IN_4BIT=1 to fit them in roughly a quarter of that at some cost in answer quality.

On dedicated hardware or CPU the spaces package is absent and the decorator becomes a no-op, so the same code runs unchanged.

Retrieval

If an index_docs/ directory is present, the Use CCP4 documentation checkbox retrieves relevant documentation sections and supplies them to the model, listing the sources used beneath the answer. Without the index the app still runs and the checkbox reports that retrieval is unavailable.

Data and limitations

Training pairs were threaded from public archives by Message-ID, cleaned of quoted history and signatures, and retained only where at least two of three adjudicating models agreed the answer was confirmed — either explicitly by the asker or by agreement among repliers.

Answers are generated and may be wrong. Verify anything consequential against the program documentation and the primary literature.