Instructions to use kvlkS/tb-research-assistant-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use kvlkS/tb-research-assistant-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "kvlkS/tb-research-assistant-lora") - Notebooks
- Google Colab
- Kaggle
TB Research Assistant β LoRA Adapter
QLoRA adapter for meta-llama/Llama-3.1-8B-Instruct, fine-tuned on TB/Mycobacterium
tuberculosis-specific instruction data (consultation-style Q&A, methodology critique,
hypothesis generation, result interpretation). This is the exact adapter deployed in the
TB Research Assistant chat app β no continued
pretraining, no retrieval, just this adapter on top of the Instruct base.
Usage
Requires accepting the Llama 3.1 license
and being logged in (huggingface-cli login) before loading the base model.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
base_id = "meta-llama/Llama-3.1-8B-Instruct"
adapter_id = "kvlkS/tb-research-assistant-lora"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
base = AutoModelForCausalLM.from_pretrained(base_id, quantization_config=bnb_config, device_map="auto")
model = PeftModel.from_pretrained(base, adapter_id)
See the full repo for the chat UI this model serves.
- Downloads last month
- 32
Model tree for kvlkS/tb-research-assistant-lora
Base model
meta-llama/Llama-3.1-8B Finetuned
meta-llama/Llama-3.1-8B-Instruct