Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TravelLeraLone committed Apr 17, 2024
1 parent c3778fc commit 6d61a2f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ChemLLMBench_eval_data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# How to format these data into inputs

For the jsonline file where the `"few_shots_examples"` key is absent in the data:

```python
text = item['question'] + item['input_format'].format(item['input']) if 'input_format' in item else item['question']
inputs = f"[Round 0]\nHuman: {text.strip()}\nAssistant:"
```

For the jsonline file where the `"few_shots_examples"` key is present in the data:

```python
inputs = f"[Round 0]\nHuman: {raw['question'].strip()}\nAssistant: OK."
for idx, fs in enumerate(raw['few_shots_examples']):
inputs += f"\n[Round {idx + 1}]\nHuman: {raw['input_format'].format(fs['human'].strip())}\nAssistant: {fs['assistant'].strip()}"
inputs += f"\n[Round {len(raw['few_shots_examples']) + 1}]\nHuman: {raw['input_format'].format(raw['input'].strip())}\nAssistant:"
```

0 comments on commit 6d61a2f

Please sign in to comment.