Upload README.md with huggingface_hub
Browse files
README.md
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- phi-2
|
5 |
+
- lora
|
6 |
+
- merged-model
|
7 |
+
- environmental-factors
|
8 |
+
- causal-lm
|
9 |
+
- transformer
|
10 |
+
---
|
11 |
+
|
12 |
+
# Phi-2 Merged Model: Environmental Emission Factors
|
13 |
+
|
14 |
+
This model is a **merged version of Microsoft's Phi-2** fine-tuned using LoRA adapters on a custom instruction dataset focused on environmental emission factors.
|
15 |
+
|
16 |
+
## ๐ Use Cases
|
17 |
+
|
18 |
+
- Query emission factors for different energy sources by country or region
|
19 |
+
- Develop mobile or web-based environmental awareness tools
|
20 |
+
- Educational and research applications around climate data
|
21 |
+
|
22 |
+
## ๐ง Model Architecture
|
23 |
+
|
24 |
+
- **Base Model**: `microsoft/phi-2`
|
25 |
+
- **Fine-tuning**: LoRA (Low-Rank Adaptation)
|
26 |
+
- **Merged**: LoRA weights merged into base model using `PeftModel.merge_and_unload()`
|
27 |
+
|
28 |
+
## ๐ Usage
|
29 |
+
|
30 |
+
Example Python code to generate responses:
|
31 |
+
|
32 |
+
`from transformers import AutoModelForCausalLM, AutoTokenizer`
|
33 |
+
|
34 |
+
`model = AutoModelForCausalLM.from_pretrained("Surendra-Aitest/phi2-env-factors-merged")`
|
35 |
+
|
36 |
+
`tokenizer = AutoTokenizer.from_pretrained("Surendra-Aitest/phi2-env-factors-merged")`
|
37 |
+
|
38 |
+
`prompt = "What is the CO2 emission factor for biomass energy in Germany?"`
|
39 |
+
|
40 |
+
`inputs = tokenizer(prompt, return_tensors="pt")`
|
41 |
+
|
42 |
+
`outputs = model.generate(**inputs, max_new_tokens=100)`
|
43 |
+
|
44 |
+
`print(tokenizer.decode(outputs[0]))`
|
45 |
+
|
46 |
+
## ๐ Files Included
|
47 |
+
|
48 |
+
- `model-00001-of-00002.safetensors` and `model-00002-of-00002.safetensors`
|
49 |
+
- `tokenizer.json`, `tokenizer_config.json`, `vocab.json`, `merges.txt`
|
50 |
+
- `generation_config.json`, `config.json`
|
51 |
+
|
52 |
+
## ๐ฌ Contact
|
53 |
+
|
54 |
+
For questions, contact: Surendra-Aitest
|