Update README.md
Browse files
README.md
CHANGED
|
@@ -7,4 +7,87 @@ metrics:
|
|
| 7 |
- accuracy
|
| 8 |
base_model:
|
| 9 |
- FreedomIntelligence/openPangu-Embedded-7B
|
| 10 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
- accuracy
|
| 8 |
base_model:
|
| 9 |
- FreedomIntelligence/openPangu-Embedded-7B
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
# AutoMR for Pangu
|
| 14 |
+
|
| 15 |
+
This project equips the Pangu model with the AutoMR reasoning framework, optimized for Huawei Ascend hardware.
|
| 16 |
+
|
| 17 |
+
## π³ Project Structure
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
.
|
| 21 |
+
βββ AMC.SH
|
| 22 |
+
βββ automr
|
| 23 |
+
βΒ Β βββ config.py
|
| 24 |
+
βΒ Β βββ dag.py
|
| 25 |
+
βΒ Β βββ data_loader.py
|
| 26 |
+
βΒ Β βββ evaluator.py
|
| 27 |
+
βΒ Β βββ __init__.py
|
| 28 |
+
βΒ Β βββ model.py
|
| 29 |
+
βΒ Β βββ strategies.py
|
| 30 |
+
βΒ Β βββ trainer.py
|
| 31 |
+
βΒ Β βββ utils.py
|
| 32 |
+
βββ checkpoints
|
| 33 |
+
βΒ Β βββ MATH
|
| 34 |
+
βββ embedder_server.sh
|
| 35 |
+
βββ generator_server.sh
|
| 36 |
+
βββ main.py
|
| 37 |
+
βββ math_train.sh
|
| 38 |
+
βββ processed_data
|
| 39 |
+
Β Β βββ AMC
|
| 40 |
+
Β Β βββ MATH
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## π§ 1. Installation
|
| 44 |
+
|
| 45 |
+
### a. Clone the Project Repository
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
hf download Alexhf825/AutoMR-pangu --local-dir AutoMR-pangu
|
| 49 |
+
cd AutoMR-pangu
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### b. Install Dependencies
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
### c. Download Datasets
|
| 56 |
+
|
| 57 |
+
This command will download the datasets and place them in the `./processed_data` directory, matching the project structure.
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
hf download Alexhf825/dataset-test-pangu --repo-type=dataset --local-dir=./processed_data
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## π 2. Start the Servers
|
| 64 |
+
|
| 65 |
+
This project requires two services running in an OpenAI-API style. Please run the following commands in **two separate terminal sessions**.
|
| 66 |
+
|
| 67 |
+
**Start the Embedder Server:**
|
| 68 |
+
|
| 69 |
+
```bash
|
| 70 |
+
bash embedder_server.sh
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
**Start the Generator Server:**
|
| 74 |
+
|
| 75 |
+
```bash
|
| 76 |
+
bash generator_server.sh
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
## π 3. Run Evaluation
|
| 80 |
+
|
| 81 |
+
A pre-trained checkpoint (`MATH`) is provided. You can directly evaluate the model on the `AMC` dataset using the following command:
|
| 82 |
+
|
| 83 |
+
```bash
|
| 84 |
+
bash AMC.sh
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
## ποΈ 4. Run Training
|
| 88 |
+
|
| 89 |
+
You can also train the model from scratch on the `MATH` dataset by running:
|
| 90 |
+
|
| 91 |
+
```bash
|
| 92 |
+
bash math_train.sh
|
| 93 |
+
```
|