Views
No views yet

| Property | Value |
|---|---|
| Base Model | Liquid AI LFM2-1.2B |
| Fine-tuning Method | LoRA using Unsloth |
| Parameters Trained | ~9M (0.78% of total) |
| Dataset Used | MIRIAD-4.4M (subset of 50,000 examples) |
| Epochs | 1 |
| Final Format | Merged (LoRA + base) |
| Model Size | 1.2 Billion |
| License | ODC-BY v1.0 dataset license, non-commercial educational use only |
| Author | Mohamed Yasser |
Do not use this dataset or models trained on it for actual medical diagnosis, decision-making, or any application involving real-world patients.
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
3
4model_name = "yasserrmd/PharmaQA-1.2B"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
7model.eval()
8
9# Example pharmacy-related question
10question = "What is the mechanism of action of metformin?"
11
12# Format as chat message
13messages = [{"role": "user", "content": f"Q: {question} A:"}]
14
15# Tokenize with chat template
16inputs = tokenizer.apply_chat_template(
17 messages,
18 add_generation_prompt=True,
19 return_tensors="pt",
20 tokenize=True,
21 return_dict=True,
22).to(model.device)
23
24# Clean input if necessary
25if "token_type_ids" in inputs:
26 del inputs["token_type_ids"]
27
28# Generate the answer
29with torch.no_grad():
30 output_ids = model.generate(
31 **inputs,
32 max_new_tokens=128,
33 temperature=0.3,
34 min_p=0.15,
35 repetition_penalty=1.05
36 )
37
38# Decode the response
39response = tokenizer.decode(output_ids[0], skip_special_tokens=True).strip()
40answer = response.split("A:")[-1].strip()
41
42print("💊 Question:", question)
43print("🧠 Answer:", answer)README.md) or want help preparing the Hugging Face push commands.