Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~12.0B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 17 |
| Layers | 24 |
| Top-k Routing | 4 |
| Context Length | 128K tokens |
| Attention Heads | 64 (Query), 8 (Key-Value) |
| Residual Dimension | 2880 |
| Attention Pattern | Alternating dense & sliding window (128 tokens) |
| Positional Encoding | RoPE (Rotary Position Embedding) |
| Normalization | RMSNorm |
| Precision | BF16 |
| License | Apache 2.0 |
| Specialization | Health Or Medicine |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load the specialized model on CPU
5model = AutoModelForCausalLM.from_pretrained(
6 "AmanPriyanshu/gpt-oss-12.0b-specialized-health_or_medicine-pruned-moe-only-17-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-12.0b-specialized-health_or_medicine-pruned-moe-only-17-experts")
12
13# Generate with the model
14messages = [
15 {"role": "user", "content": "What are the main functions of the human heart?"}
16]
17
18inputs = tokenizer.apply_chat_template(
19 messages,
20 add_generation_prompt=True,
21 return_tensors="pt",
22 return_dict=True,
23 reasoning_effort="medium"
24)
25
26# Ensure inputs are on the same device as model
27inputs = {k: v.to(model.device) for k, v in inputs.items()}
28
29outputs = model.generate(
30 **inputs,
31 max_new_tokens=512,
32 do_sample=True,
33 temperature=0.1,
34 top_p=0.9,
35 pad_token_id=tokenizer.eos_token_id,
36 eos_token_id=tokenizer.eos_token_id
37)
38
39# Decode only the generated part
40input_length = inputs['input_ids'].shape[1]
41response_tokens = outputs[0][input_length:]
42response = tokenizer.decode(response_tokens, skip_special_tokens=True)
43print(response)1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Check MPS availability and load model
5device = "mps" if torch.backends.mps.is_available() else "cpu"
6
7model = AutoModelForCausalLM.from_pretrained(
8 "AmanPriyanshu/gpt-oss-12.0b-specialized-health_or_medicine-pruned-moe-only-17-experts",
9 torch_dtype=torch.float16, # Better MPS compatibility
10 device_map=device,
11 trust_remote_code=True,
12 low_cpu_mem_usage=True
13)
14tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-12.0b-specialized-health_or_medicine-pruned-moe-only-17-experts")
15
16# Generate with the model
17messages = [
18 {"role": "user", "content": "What are the main functions of the human heart?"}
19]
20
21inputs = tokenizer.apply_chat_template(
22 messages,
23 add_generation_prompt=True,
24 return_tensors="pt",
25 return_dict=True,
26 reasoning_effort="medium"
27)
28
29# Move inputs to model device
30inputs = {k: v.to(model.device) if isinstance(v, torch.Tensor) else v for k, v in inputs.items()}
31
32# Use torch.no_grad for MPS stability
33with torch.no_grad():
34 outputs = model.generate(
35 **inputs,
36 max_new_tokens=512,
37 do_sample=True,
38 temperature=0.1,
39 top_p=0.9,
40 pad_token_id=tokenizer.eos_token_id,
41 eos_token_id=tokenizer.eos_token_id,
42 use_cache=True
43 )
44
45# Decode only the generated part
46input_length = inputs['input_ids'].shape[1]
47response_tokens = outputs[0][input_length:]
48response = tokenizer.decode(response_tokens, skip_special_tokens=True)
49print(response)1device_map="auto" # Will automatically use GPU if available
2torch_dtype=torch.bfloat16 # or torch.float16<|channel|>analysis<|message|>Need answer.<|end|><|start|>assistant<|channel|>final<|message|>The human heart is a muscular organ that performs several essential functions to keep the body alive and functioning. Its main roles can be grouped into three broad categories:
| **Primary Function** | **What It Does** | **Why It Matters** |
|---------------------|----------------|----------------|
| **Pumping Blood** | The heart contracts (systole) and relaxes (diastole) to push blood through the circulatory system. | Keeps oxygen, nutrients, hormones, and waste products delivered to and removed from every cell. |
| **Maintaining Blood Pressure** | By regulating the force and rate of contraction, the heart sets the pressure needed to move blood against resistance in the vessels. | Keeps tissues perfused and prevents shock or organ failure. |
| **Regulating Blood Flow** | The heart’s rhythm and contractility are adjusted by the nervous system and hormones to match the body’s needs (e.g., exercise, rest, stress). | Allows the body to respond quickly to changing demands. |
### How the Heart Performs These Functions
1. **Electrical Conduction System**
- **Sinoatrial (SA) node**: natural pacemaker that initiates each heartbeat.
- **Atrioventricular (AV) node**: delays conduction to allow atria to finish contracting before ventricles.
- **Bundle of His → Purkinje fibers**: conduct impulses through ventricles, coordinating ventricular contraction.
2. **Cardiac Muscle (Myocardium)**
- **Contractile fibers**: generate force to pump blood.
- **Intercalated discs**: specialized junctions that allow rapid spread of electrical impulses and mechanical coupling between cells.
3. **Valvular System**
- **Aortic, pulmonary, mitral, and tricuspid valves**: prevent back‑flow of blood, ensuring unidirectional flow from chambers to major vessels.
4. **Autonomic Regulation**
- **Sympathetic nervous system**: increases heart rate and contractility (fight‑or‑flight).
- **Parasympathetic (vagal) tone**: slows heart rate (rest, relaxation).
- **Hormonal influences**: catecholamines, angiotensin II, atrial natriuretic peptide, etc., fine‑tune cardiac output.
5. **Metabolic Support**
- **Coronary circulation**: supplies<|channel|>analysis<|message|>Need explain differences.<|end|><|start|>assistant<|channel|>final<|message|>**Bacteria vs. Viruses – the big differences**
| Feature | Bacteria | Viruses |
|---|---|---|
| **Basic nature** | Single‑cell, living organisms (prokaryotes) | Particles that are not living; they are just a package of genetic material surrounded by a coat (capsid) and sometimes a lipid envelope |
| **Size** | 1 µm to 10 µm (about 1000‑10,000 nm) | 0.25 µm to 0.5 µm (250‑500 nm) – roughly 100‑200 nm for most |
| **Structure** | Cell wall, plasma membrane, cytoplasm, ribosomes, DNA (often circular) | Genome (DNA or RNA, single or double strand), capsid, sometimes envelope; no internal organelles |
| **Reproduction** | Cell division (mitotic‑like) – one cell splits into two, then two into four, etc. | Replication inside a host cell: the virus injects its genome, hijaxes the host’s machinery to make copies of its genome and proteins, then assembles new particles |
| **Genetic material** | DNA (most) | DNA or RNA (single‑ or double‑strand) |
| **Energy source** | Metabolism – can produce energy from nutrients (photosynthesis, respiration, fermentation) | No metabolism; relies entirely on the host cell’s enzymes and energy |
| **Life cycle** | Can survive outside hosts (in soil, water, on surfaces) | Usually need a living host cell to produce new copies; many are short‑lived outside a host |
| **Infection mechanism** | Attach to host cells, penetrate, grow, and release new cells (often by lysis or budding) | Attach to host cells, inject genome, replicate, assemble, and exit (lysis, budding, or exocytosis) |
| **Immune response** | Recognized by innate and adaptive immunity; can be targeted by antibiotics, phage therapy, etc. | Recognized by innate and adaptive immunity; targeted by antiviral drugs, vaccines, monoclonal antibodies |
| **Treatment** | Antibiotics (target cell wall, protein synthesis, DNA replication, etc.) | Antivirals (target viral enzymes, entry, replication, etc.) |
| **Examples** | *Escherichia coli*,<|channel|>analysis<|message|>Need to answer.<|end|><|start|>assistant<|channel|>final<|message|>**Diabetes mellitus** is a chronic metabolic disorder in which the body cannot regulate blood glucose properly. The two most common types are:
| Type | Main cause | Typical symptoms |
|------|------------|-----------------|
| **Type 1** (juvenile‑onset) | Autoimmune destruction of insulin‑producing β‑cells in the pancreas → little or no insulin | • Sudely rapid weight loss<br>• Polyphagia (constant hunger)<br>• Poluria (fre frequent urination)<br>• Polyphoria (fre frequent thirst)<br>• Fatigue, weakness<br>• Frequent infections (especially in the skin, mouth, and urinary tract)<br>• Delayed wound healing |
| **Type 2** (adult‑onset) | Insulin resistance in peripheral tissues + relative insulin deficiency | • Gradual weight gain or obesity (especially abdominal)<br>• Polyphagia, poluria, polyphoria (often milder than type 1)<br>• Fatigue, blurred vision, slow wound healing<br>• Occasional tingling or numbness in extremities (early neuropathy)<br>• Dark, itchy skin (acanthosis nigricans) in some cases |
---
### Common symptoms (present in both types)
1. **Polyphagia** – constant, unrelating hunger.
2. **Poluria** – increased frequency and volume of urination.
3. **Polydipsia** – excessive thirst.
4. **Weight changes** – rapid loss in type 1; gradual gain in type 2.
5. **Fatigue and weakness** – due to cells not getting glucose.
6. **Blurred vision** – hyperglycemia causes fluid shifts in the eye.
7. **Infections** – especially skin, mouth, and urinary tract.
8. **Delayed wound healing** – impaired blood flow and immune function.
9. **Peripheral neuropathy** – tingling, numbness, or pain in hands/feet.
10. **Anemia** – low red‑cell count (especially in type 1).
---
### Causes
| Factor | How it contributes to diabetes |
|--------|------------------------------|
| **Autoimmune attack** (type 1) | The immune system mistakenly targets β‑cells → loss of insulin production. |
| **Insulin resistance** (type 21@misc{priyanshu2025gptoss,
2 title={{GPT-OSS MoE Expert Fingerprinting: Analyzing Expert Activation Patterns in Mixture of Experts Models}},
3 author={Priyanshu, Aman and Vijay, Supriti},
4 year={2025},
5 howpublished={\url{https://amanpriyanshu.github.io/GPT-OSS-MoE-ExpertFingerprinting/}},
6 note={Interactive analysis tool for expert activation patterns in MoE architectures}
7}