Skip to content

Commit 2d19d26

Browse files
committed
improve readme, docs, and examples huggingface
1 parent df943d0 commit 2d19d26

File tree

10 files changed

+1604
-51
lines changed

10 files changed

+1604
-51
lines changed

README.md

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -115,33 +115,17 @@ critical_steps = critical_steps_metric(main_steps, sub_steps)
115115
print(f"Critical Steps: {critical_steps}")
116116
```
117117

118-
## API Reference
119-
120-
### `PARLReward`
121-
122-
Main reward function implementing staged reward shaping.
123-
124-
**Parameters:**
125-
- `lambda_init` (float): Initial auxiliary reward weight (default: 0.1)
126-
- `lambda_final` (float): Final auxiliary reward weight (default: 0.0)
127-
- `total_training_steps` (int): Total training steps for annealing (default: 10000)
128-
- `device` (str): Device for computation ('cpu' or 'cuda')
129-
130-
**Methods:**
131-
- `compute_full_reward()`: Compute all reward components
132-
- `compute_instantiation_reward()`: Calculate parallelism incentive
133-
- `compute_task_quality()`: Calculate task success quality
134-
- `anneal_lambda()`: Get current λ_aux value
135-
136-
### `CriticalStepsMetric`
118+
## Examples
137119

138-
Latency-oriented evaluation metric for parallel execution.
120+
| Example | File | Description | Requirements |
121+
|---------|------|-------------|-------------|
122+
| **Basic Usage** | `basic_usage.py` | Core PARL reward function and Critical Steps metric without external models | `open-parl` only |
123+
| **Quick Start (HF)** | `quickstart_hf.py` | Minimal integration with Hugging Face GLM-4.7-Flash model | `transformers`, `torch`, `accelerate` |
124+
| **Full HF Integration** | `huggingface_integration.py` | Complete orchestrator class with training loop, batching, and reward analysis | `transformers`, `torch`, `accelerate` |
139125

140-
**Parameters:**
141-
- `orchestration_overhead` (float): Overhead for orchestrator coordination (default: 0.1)
126+
## API Reference
142127

143-
**Methods:**
144-
- `forward()`: Compute critical steps for parallel workflows
128+
For detailed API documentation, see [docs/API.md](docs/API.md).
145129

146130
## Experiments
147131

@@ -193,26 +177,7 @@ If you use PARL in your research, please cite:
193177
}
194178
```
195179

196-
## Project Structure
197-
198-
```
199-
PARL/
200-
├── parl/
201-
│ ├── __init__.py # Package initialization
202-
│ └── main.py # Core PARL implementation
203-
├── tests/
204-
│ └── test_parl.py # Comprehensive test suite
205-
├── pyproject.toml # Poetry configuration
206-
├── README.md # This file
207-
├── LICENSE # Apache 2.0 License
208-
└── .gitignore # Git ignore rules
209-
```
210-
211-
## Requirements
212180

213-
- Python >= 3.8
214-
- PyTorch >= 2.0.0
215-
- NumPy >= 1.24.0
216181

217182
## Contributing
218183

0 commit comments

Comments
 (0)