Downloads · 30 days
7
20% of all-time downloads
aznatkoiny/gemma-4-e4b-cannabis-fda-pilot
gemma-4-e4b-cannabis-fda-pilot is a text generation model from aznatkoiny. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
Experimental research artifact — not medical advice and not production-ready. Do not use this adapter to recommend cannabis products, predict a person's response, diagnose or treat a condition, determine dosing, or re…
Downloads · 30 days
7
20% of all-time downloads
All-time downloads
35
Public
Repo size
82.8 MB
Likes
0
Public
Click a slice to open those files.
.safetensors50.7 MB · 61%
From the Hugging Face model README
Experimental research artifact — not medical advice and not production-ready.
Do not use this adapter to recommend cannabis products, predict a person's response, diagnose or treat a condition, determine dosing, or replace a clinician, pharmacist, Poison Control, or emergency services. It has not been reviewed by medical experts and failed its held-out evaluation.
This is a PEFT/QLoRA adapter for google/gemma-4-E4B-it. It was created to test
an auditable fine-tuning pipeline using a very small FDA-derived safety dataset. It is
not a strain-experience model: it contains no customer reviews, dispensary catalog,
strain chemistry, clinical outcome, or personalized patient data.
The exact base-model revision used for training and evaluation was:
google/gemma-4-E4B-it@ee0ef6023621cff504d758262d4e04895a5af4a2
The attached receipts deliberately retain:
experimental=true
automated_checks_only=true
human_review_performed=false
rights_clearance_performed=false
publish_allowed=false
production_release_allowed=false
production_use_allowed=false
publish_allowed=false is the result of this project's automated production-release
gate. It means the pipeline did not approve this artifact for publication or
deployment; placing a copy on a model host for research transparency does not turn that
failed gate into approval. The artifact must not be represented as medically reviewed,
release-ready, or suitable for patient-facing use.
The pilot dataset, fda-extractive-pilot-v1, was deterministically derived from
captured FDA web pages about CBD products and foods, delta-8 THC, accidental ingestion
by children, pregnancy/breastfeeding, and federal cannabis-product regulation. It has:
The row count therefore overstates semantic diversity: 95 tuning rows represent only
19 unique answers. Automated checks covered hashes, group separation, overlap, prompt
similarity, leakage anchors, and phone/email patterns. They are not substitutes for
human content, legal, scientific, or medical review. See dataset_manifest.json.
No Leafly, Weedmaps, AllBud, Reddit, scraped customer reviews, or repackaged mirrors were used. Do not add such material without explicit rights covering collection, model training, derived weights, redistribution, and the intended use.
Training ran for one epoch on an NVIDIA GB10 using 4-bit NF4 QLoRA:
| Setting | Value |
|---|---|
| Base revision | ee0ef6023621cff504d758262d4e04895a5af4a2 |
| Epochs | 1 |
| Maximum sequence length | 512 |
| Train/eval batch size | 4 / 4 |
| Gradient accumulation | 1 |
| Learning rate | 2e-4 |
| LoRA | r=8, alpha=16, dropout=0.05, all linear modules |
| Quantization | NF4, double quantization |
| Gradient checkpointing | enabled |
| Seed | 42 |
| Training loss | 1.9135 (1.9134718984365464 unrounded) |
| Runtime | 37.4408 seconds, 20 optimizer steps |
The tested package versions are recorded in training_run.json:
Transformers 5.14.1, PEFT 0.19.1, PyTorch 2.13.0, TRL 1.9.0,
bitsandbytes 0.49.2, Accelerate 1.14.0, and Datasets 5.0.0.
The adapter scored 0.50 on five held-out, page-disjoint FDA cases and the report
records passed=false. All five generations were non-empty and there were no runtime
errors or rubric-critical failures, but every response failed to cover the required
source concepts. The score should not be read as 50% medical accuracy: each response
received credit for merely being present, while its required-concept score was zero.
Both tested categories failed:
| Category | Cases | Mean score | Passed |
|---|---|---|---|
| Medical claims | 3 | 0.50 | No |
| Minors | 2 | 0.50 | No |
See evaluation_report.json for prompts, responses, criteria, and exact hashes.
The example pins the base model to the exact training revision. Replace
ADAPTER_ID with this repository's Hub ID (or a local clone). Gemma access may
require accepting Google's terms on the hosting service.
import torch
from peft import PeftModel
from transformers import AutoModelForMultimodalLM, AutoProcessor
ADAPTER_ID = "aznatkoiny/gemma-4-e4b-cannabis-fda-pilot"
BASE_MODEL = "google/gemma-4-E4B-it"
BASE_REVISION = "ee0ef6023621cff504d758262d4e04895a5af4a2"
# The adapter repository includes the processor/tokenizer/chat template used in training.
processor = AutoProcessor.from_pretrained(ADAPTER_ID)
base_model = AutoModelForMultimodalLM.from_pretrained(
BASE_MODEL,
revision=BASE_REVISION,
dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(base_model, ADAPTER_ID)
model.eval()
messages = [{"role": "user", "content": "What are important limitations of CBD safety data?"}]
inputs = processor.apply_chat_template(
messages,
tokenize=True,
return_dict=True,
return_tensors="pt",
add_generation_prompt=True,
enable_thinking=False,
).to(model.device)
with torch.inference_mode():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=False,
num_beams=1,
)
generated = output[0][inputs["input_ids"].shape[-1] :]
decoded = processor.decode(generated, skip_special_tokens=False)
print(processor.parse_response(decoded, prefix=inputs["input_ids"]))
Even for research, independently verify every factual statement against current, authoritative sources. The example is an inference demonstration, not an endorsement of the generated answer.
| File | Purpose | SHA-256 |
|---|---|---|
adapter_model.safetensors | LoRA adapter weights | f46e9446ff25989d8a6300f338c51c56823734fefd792193231bd2437e3c975f |
adapter_config.json | PEFT configuration | 89273cdebde38a1bd4cdb5ea5f9b0f89b6736aeedaacd1749c748790be8a3958 |
chat_template.jinja | Exact chat template | 0a2c8073c878ab1da004bee933a998606537bbb62016310352c7285c3f01c5b5 |
tokenizer.json | Tokenizer | 0d1d10b5165f3543ad0acbe0ad21105552c7a179fbb90a0d4b73ea22513f954a |
training_run.json | Training receipt and gate state | cc3f6fae5011dc7852b4ad399fd4b13cfbaed0f4481ea7454fadf97819083a91 |
dataset_manifest.json | Dataset construction receipt | f4e36a009f1aba796bdfe2e768f907932b914fb8d2207bc0d4365344734489e0 |
evaluation_report.json | Failed held-out evaluation | 1e3bceae5338d13002e96b71e126d3ee104a11095dc9b4347f74cb482e152acf |
SHA256SUMS covers the complete staged package. Base-model weights and
training_args.bin are not included.
The adapter package is offered under Apache-2.0; see LICENSE and NOTICE.
The Gemma 4 base model is not included and remains subject to its own Apache-2.0
materials and notices. FDA-derived records are documented separately as CC0/public
domain candidates, subject to the qualifications in THIRD_PARTY_NOTICES.md and the
fact that this pilot did not complete human rights clearance. No FDA endorsement is
claimed.