Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~9.6B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 13 |
| 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-9.6b-specialized-health_or_medicine-pruned-moe-only-13-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-9.6b-specialized-health_or_medicine-pruned-moe-only-13-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-9.6b-specialized-health_or_medicine-pruned-moe-only-13-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-9.6b-specialized-health_or_medicine-pruned-moe-only-13-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 to answer: main functions: pumping blood, regulating blood pressure, oxygen delivery, nutrient transport, endocrine functions (h hormones), etc.<|end|><|start|>assistant<|channel|>final<|message|>The human heart is a vital organ that performs several key functions essential for life. Its primary roles can be grouped into three main categories:
| **Primary Functions** | **What Does It Do?** | **Why It Matters** |
|------------------------|------------------------|------------------------|
| **P pumping blood** | The heart’s rhythmic contractions (the heartbeat) move blood through the circulatory system. | Keeps oxygen, nutrients, and waste products circulating throughout the body. |
| **Regulating blood pressure** | By adjusting the force of its contractions (stroke volume) and the rate of heartbeats (heart rate), the heart controls the pressure that blood exsors on the blood vessels. | Maints a stable blood pressure that is necessary for proper organ perfusion and fluid balance. |
| **O‑delivery & nutrient transport** | The heart’s pumping action ensures that oxygen and nutrients reach every tissue and organ, while also removing waste products (CO₂, metabolic by‑products) from the blood. | Keeps every cell alive and functioning. |
In addition, the heart has several secondary functions that support its primary roles:
1. **End‑organ regulation** – The heart’s rhythm and force of contraction are influenced by the autonomic nervous system (sym‑ and parasym‑), hormones (e.g., adrenaline, nor‑adrenaline, angiotensin II), and local chemical signals (e.g., oxygen, CO₂).
2. **Hormone production** – The atrial cells produce atr natriuretic peptide (ANP) and brain natriuretic peptide (BNP), which help regulate fluid balance and blood pressure.
3. **Mechanical support** – The heart’s structure (four chambers, valves, and the conduction system) ensures that blood flows in the correct direction and that the blood volume is properly distributed.
**In short:** The heart’s main functions are to pump blood, regulate blood pressure, and deliver oxygen and nutrients to every tissue while removing waste products. These functions keep the body’s internal environment stable and allow all organs to operate efficiently.<|return|><|channel|>analysis<|message|>Need explain differences: size, structure, replication, genetics, etc.<|end|><|start|>assistant<|channel|>final<|message|>**Bacteria vs. Viruses – The Bottom‑Line Differences**
| Feature | Bacteria | Viruses |
|---------|----------|--------|
| **Definition** | Single‑cell, living organisms that can grow, divide, and reproduce on their own. | Tiny particles (≤ 100 nm) that are not living cells; they need a host cell to replicate. |
| **Size** | 1 µm – 10 µm (microscopic, but still visible under a microscope). | 100 – 200 nm (usually invisible to the naked eye). |
| **Structure** | • Cell wall (peptidoglycan in Gram‑positive, peptidoglycan + teichoic acids in Gram‑negative, or none in archaea). <br>• Cytoplasm, ribosomes, DNA, mitochondria (in e‑eobacteria), flagella, pili, etc. | • No cell‑like organelles. <br>• Envelope (lipid membrane) or capsid (protein shell) that protects the genome. |
| **Genetic Material** | • DNA (usually 4 bases, double‑stranded). | • DNA or RNA (single‑stranded or double‑stranded). |
| **Replication** | • Cell division (mitosis‑like process). <br>• Can grow exponentially (douts per hour). | • Must hijate host‑cell machinery. <br>• No self‑division; replication is a “copy‑and‑paste” of its genome. |
| **Energy Source** | • Metabolism: glycolysis, respiration, photosynthesis, etc. <br>• Can produce ATP, NADH, etc. | • No metabolic pathways; they simply use the host’s energy. |
| **Infection Mechanism** | • Attach to host cells, invade, and multiply. <br>• Can be pathogenic or symbiotic. | • Attach to a receptor, inject genome, commandeer host cell to produce new particles. |
| **Treatment** | • Antibiics (target cell wall, protein synthesis, DNA replication). | • Antivirals (target viral enzymes, replication steps). |
| **Evolutionary History** | • E‑eobacteria (ancestors of all life). <br>• Archaea and pro‑eobacteria<|channel|>analysis<|message|>Need to explain symptoms and causes.<|end|><|start|>assistant<|channel|>final<|message|>**Diabetes mellitus** is a chronic metabolic disorder that occurs when the body cannot produce enough insulin (type 1) or cannot use insulin effectively (type 2). The result is high blood glucose (hyper‑glycemia) that can damage organs and tissues over time. Below is a quick overview of the most common symptoms and the main causes for each type.
---
## 1. Symptoms of Diabetes
| Symptom | Why it happens | When it usually appears |
|--------|----------------|------------------------|
| **Freckly sweet or sticky mouth** | High glucose in saliva | Early or later |
| **Freckly thirst** | Body tries to ex‑elate glucose | Early or later |
| **Freckly urination** | Kidneys ex‑elate glucose | Early or later |
| **Weight loss** (type 2) | Loss of energy from glucose | Early or later |
| **Fatigue / low energy** | Cells can’t use glucose | Early or later |
| **Poor wound healing** | High glucose impairs immunity | Later |
| **Blurred vision / eye problems** | Hyper‑glycemia damages retina | Later |
| **Nnerner pain or numbness** | Damage to small nerves | Later |
| **Increased infections** | Immune system weakened | Later |
| **Ack (type 1)** | Auto‑immune destruction of beta‑cells | Early (often in 2‑3 weeks) |
| **Ack (type 2)** | Insulin resistance & β‑cell exhaustion | Later (months‑years) |
> **Note** – Many people with type 2 diabetes have *no* obvious symptoms early on. They may only discover the problem when a routine blood test shows high glucose.
---
## 2. Causes of Diabetes
### Type 1 Diabetes (T‑1D)
| Cause | Mechanism | Risk factors |
|--------|------------|--------------|
| **Auto‑immune attack on pancreatic β‑cells** | The immune system mistakenly targets insulin‑producing cells | • Genetics (family history) <br>• Viral infections (e.g., enteroviruses) <br>• Environmental triggers (e.g., diet, hygiene) |
| **Genetic predisposition** | Certain genes (e.g., H‑DQ, H‑DR) increase susceptibility | • First‑generation parents <1@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}