llama-stack/llama_stack/providers/inline/post_training/torchtune/datasets
Xi Yan 15f69e75ff
fix: replace eval with json decoding for format_adapter (#1328)
# What does this PR do?
- using `eval` is a security risk

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan

- see https://github.com/meta-llama/llama-stack/pull/1327

cc @SLR722 we will need to update the corresponding dataset via

```python
def update_to_json_str():
        
dataset = datasets.load_dataset(...)
processed_dataset = dataset[split].map(
        lambda x: {
                "column": json.dumps(eval(x["column"]))
       }
)
processed_dataset.push_to_hub(...)
```
[//]: # (## Documentation)
2025-02-28 11:25:23 -08:00
..
__init__.py Add init files to post training folders (#711) 2025-01-13 20:19:18 -08:00
format_adapter.py fix: replace eval with json decoding for format_adapter (#1328) 2025-02-28 11:25:23 -08:00
sft.py build: format codebase imports using ruff linter (#1028) 2025-02-13 10:06:21 -08:00