Skip to content

Commit 5620bc8

Browse files
authored
Adding getting started, and QAExample reward metadata match ds (#4)
1 parent cc5dfc2 commit 5620bc8

File tree

4 files changed

+278
-6
lines changed

4 files changed

+278
-6
lines changed

README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ether0 is a reasoning language model post-trained through a loop of:
3030
4. SFT on the base model again to make a 'generalist' reasoning model.
3131
5. RLVR to recover any lost performance and push further in an all-task setting.
3232

33-
![ether0 logo](docs/assets/training_info.png)
33+
![ether0 training info](docs/assets/training_info.png)
3434

3535
### Repo Structure
3636

@@ -68,3 +68,63 @@ from datasets import load_dataset
6868

6969
test_ds = load_dataset("futurehouse/ether0-benchmark", split="test")
7070
```
71+
72+
## Usage
73+
74+
### Installation
75+
76+
The easiest way to get started is a `pip install` from GitHub:
77+
78+
```bash
79+
pip install git+https://github.com/Future-House/ether0.git
80+
```
81+
82+
Or if you want the full set up, clone the repo and use `uv`:
83+
84+
```bash
85+
git clone https://github.com/Future-House/ether0.git
86+
cd ether0
87+
uv sync
88+
```
89+
90+
### Reward Functions
91+
92+
Here is a basic example of how to use the reward functions:
93+
94+
```python
95+
from ether0.rewards import valid_mol_eval
96+
97+
# Task: provide a valid completion of this molecule
98+
partial_smiles = "O=C(OC1C(OC(=O)C=2C=CC=CC2)C3(O)C(C)(C)CCCC3(C)C4CC=5OC=CC5C(C)C14"
99+
100+
# Here's two model-proposed SMILES completions
101+
invalid_completion_smiles = "CCC"
102+
valid_completion_smiles = ")C=6C=CC=CC6"
103+
104+
# Evaluate the completions
105+
assert not valid_mol_eval(invalid_completion_smiles, partial_smiles)
106+
assert valid_mol_eval(valid_completion_smiles, partial_smiles)
107+
```
108+
109+
### Visualization
110+
111+
If it helps, you can visualize the molecules:
112+
113+
```python
114+
from ether0.data import draw_molecule
115+
116+
# See above reward functions demo for where these came from
117+
partial_smiles = "O=C(OC1C(OC(=O)C=2C=CC=CC2)C3(O)C(C)(C)CCCC3(C)C4CC=5OC=CC5C(C)C14"
118+
invalid_completion_smiles = "CCC"
119+
valid_completion_smiles = ")C=6C=CC=CC6"
120+
121+
valid_mol_text = draw_molecule(partial_smiles + valid_completion_smiles)
122+
with open("valid_molecule.svg", "w") as f:
123+
f.write(valid_mol_text)
124+
```
125+
126+
The output of `draw_molecule` can also be easily visualized using `IPython.display`,
127+
or in your terminal via `chafa valid_molecule.svg`
128+
([chafa docs](https://hpjansson.org/chafa/)).
129+
130+
![valid molecule](docs/assets/valid_molecule.svg)

docs/assets/valid_molecule.svg

Lines changed: 211 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)