BoomJules commited on
Commit
afa33b8
Β·
verified Β·
1 Parent(s): f85df9e

docs: specialist card with usage, examples and family index

Browse files
Files changed (1) hide show
  1. README.md +131 -14
README.md CHANGED
@@ -1,26 +1,143 @@
1
  ---
2
- base_model: meta-llama/Llama-3.1-8B-Instruct
3
  library_name: peft
 
 
 
 
 
4
  tags:
5
  - lora
 
6
  - molly-os
7
  - specialist
8
- - materials_science
9
- license: llama3.1
 
10
  ---
11
 
12
- # Molly OS β€” Specialist Adapter: Polymer Chemist
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
- LoRA specialist adapter for the **Molly OS** model-agnostic orchestration layer.
 
15
 
16
- - **Domain:** Materials Science
17
- - **Role:** Polymer Chemist
18
- - **Base model:** `meta-llama/Llama-3.1-8B-Instruct`
19
- - **Adapter type:** LoRA (PEFT), rank **32**, alpha **64**
20
- - **Training records:** 187
21
 
22
- This adapter is one of a curated set of domain specialists orchestrated by Molly.
23
- Load it on top of the base model via PEFT or serve it through a multi-LoRA vLLM
24
- endpoint. Intended for research/demo use alongside the Molly OS whitepaper.
25
 
26
- Β© 2026 Corelabs Group.
 
1
  ---
 
2
  library_name: peft
3
+ base_model: meta-llama/Llama-3.1-8B-Instruct
4
+ pipeline_tag: text-generation
5
+ language:
6
+ - en
7
+ license: cc-by-nc-4.0
8
  tags:
9
  - lora
10
+ - peft
11
  - molly-os
12
  - specialist
13
+ - polymer-chemist
14
+ - llama-3.1
15
+ - domain-adaptation
16
  ---
17
 
18
+ # Molly Specialist β€” Polymer Chemist
19
+
20
+ Predicts copolymer composition from monomer reactivity ratios, recommends controlled polymerization conditions, and estimates thermal properties of synthesized polymers.
21
+
22
+ Part of **[Molly](https://iamolly.ai/?utm_source=huggingface&utm_medium=model_card&utm_campaign=specialists&utm_content=molly-polymer-chemist)**, an orchestrator that keeps a library of small domain
23
+ specialists over one quantized base and routes each request to the right one, so a
24
+ single machine answers across many fields without loading a separate large model
25
+ for each.
26
+
27
+ ## What this specialist handles well
28
+
29
+ - Predicts copolymer composition from monomer reactivity ratios
30
+ - Recommends initiators and conditions for controlled radical polymerization
31
+ - Estimates glass transition and decomposition temperatures for polymers
32
+
33
+ ## Try it with
34
+
35
+ - "What monomer feed ratio gives a 50/50 copolymer of styrene and methyl methacrylate?"
36
+ - "Which chain transfer agent best controls molecular weight in RAFT polymerization of acrylamides?"
37
+ - "How does tacticity affect the glass transition temperature of poly(methyl methacrylate)?"
38
+
39
+ ## Before you run: the base model is gated
40
+
41
+ This adapter needs the base weights, and the base is **access-gated**. Do this **once**:
42
+
43
+ 1. Accept the base licence: <https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct>
44
+ 2. Create a **read token**: <https://huggingface.co/settings/tokens>
45
+ 3. Make the token available:
46
+ - **Google Colab:** Secrets panel (key icon) β†’ *Add new secret* β†’ name `HF_TOKEN`, enable **Notebook access**.
47
+ - **Kaggle:** *Add-ons β†’ Secrets* β†’ add `HF_TOKEN`.
48
+ - **Local:** `huggingface-cli login` or `export HF_TOKEN=...`
49
+
50
+ Skipping this gives `GatedRepoError` / `401 Unauthorized` when the **base** loads. A stored
51
+ Colab secret is **not** applied automatically β€” authenticate in code, as below.
52
+
53
+ ## Quickstart
54
+
55
+ ```python
56
+ # pip install -U transformers peft accelerate
57
+ import os, torch
58
+ from huggingface_hub import login
59
+ try:
60
+ from google.colab import userdata
61
+ login(userdata.get("HF_TOKEN"))
62
+ except Exception:
63
+ tok = os.environ.get("HF_TOKEN")
64
+ login(tok) if tok else login()
65
+
66
+ from transformers import AutoModelForCausalLM, AutoTokenizer
67
+ from peft import PeftModel
68
+
69
+ BASE = "meta-llama/Llama-3.1-8B-Instruct"
70
+ ADAPTER = "BoomJules/molly-polymer-chemist"
71
+
72
+ tok = AutoTokenizer.from_pretrained(BASE)
73
+ base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto")
74
+ model = PeftModel.from_pretrained(base, ADAPTER).eval()
75
+
76
+ msgs = [{"role": "user", "content": "Your question here"}]
77
+ ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
78
+ out = model.generate(ids, max_new_tokens=300)
79
+ print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
80
+ ```
81
+
82
+ ## Low-VRAM (4-bit) β€” fits a free Colab/Kaggle GPU (~6–7 GB)
83
+
84
+ ```python
85
+ # pip install -U transformers peft accelerate bitsandbytes
86
+ import os, torch
87
+ from huggingface_hub import login
88
+ try:
89
+ from google.colab import userdata
90
+ login(userdata.get("HF_TOKEN"))
91
+ except Exception:
92
+ login(os.environ.get("HF_TOKEN"))
93
+
94
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
95
+ from peft import PeftModel
96
+
97
+ bnb = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4",
98
+ bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True)
99
+ tok = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
100
+ base = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct", quantization_config=bnb, device_map="auto")
101
+ model = PeftModel.from_pretrained(base, "BoomJules/molly-polymer-chemist").eval()
102
+ ```
103
+
104
+ ## Adapter details
105
+
106
+ | | |
107
+ |---|---|
108
+ | Base model | `meta-llama/Llama-3.1-8B-Instruct` |
109
+ | Method | LoRA (PEFT) |
110
+ | Rank / alpha | 32 / 64 |
111
+ | Domain | Polymer Chemist |
112
+
113
+ ## Troubleshooting
114
+
115
+ - **`GatedRepoError` / `401 Unauthorized`** β€” base licence not accepted, or `HF_TOKEN` missing,
116
+ or the Colab secret was stored but `login(...)` was never called.
117
+ - **CUDA out of memory** β€” use the 4-bit snippet on a GPU runtime.
118
+ - **Adapter seems to have no effect** β€” confirm the base id matches `base_model` above.
119
+
120
+ ## Other Molly specialists
121
+
122
+ - [Quantum Software Architect](https://huggingface.co/BoomJules/molly-quantum-software-architect)
123
+ - [Quantum Communication Systems Engineer](https://huggingface.co/BoomJules/molly-quantum-communication-systems-engineer)
124
+ - [Infectious Disease Physician Antimicrobial Stewardship](https://huggingface.co/BoomJules/molly-infectious-disease-physician-antimicrobial-stewardship)
125
+ - [Health Informatics Medical AI Specialist](https://huggingface.co/BoomJules/molly-health-informatics-medical-ai-specialist)
126
+ - [Clinical Trial Pharmacologist](https://huggingface.co/BoomJules/molly-clinical-trial-pharmacologist)
127
+ - [Immunopharmacologist](https://huggingface.co/BoomJules/molly-immunopharmacologist)
128
+ - [Climate Analytics Manager](https://huggingface.co/BoomJules/molly-climate-analytics-manager)
129
+ - [Language Technology Consultant](https://huggingface.co/BoomJules/molly-language-technology-consultant)
130
+ - [Composite Materials Engineer](https://huggingface.co/BoomJules/molly-composite-materials-engineer)
131
+ - [Computer Science AI](https://huggingface.co/BoomJules/molly-cs-ai)
132
+ - [Computer Science Algorithms](https://huggingface.co/BoomJules/molly-cs-algorithms)
133
+ - [Computer Science Computer Vision](https://huggingface.co/BoomJules/molly-cs-cv)
134
 
135
+ Running several of these at once, with the routing decided for you, is what
136
+ [Molly](https://iamolly.ai/?utm_source=huggingface&utm_medium=model_card&utm_campaign=specialists&utm_content=molly-polymer-chemist) does.
137
 
138
+ ## Licence & intended use
 
 
 
 
139
 
140
+ Adapter: **CC BY-NC 4.0** (attribution, non-commercial). Base model: its own licence.
141
+ Intended for research and evaluation in Polymer Chemist.
 
142
 
143
+ Β© 2026 Core Labs R&D.