eladrich / pyrallis

Pyrallis is a framework for structured configuration parsing from both cmd and files. Simply define your desired configuration structure as a dataclass and let pyrallis do the rest!
https://eladrich.github.io/pyrallis/
MIT License
198 stars 7 forks source link

Running on a notebook (such as Colab)? #18

Closed jakeoung closed 2 years ago

jakeoung commented 2 years ago

First of all, thanks for this amazing library.

I try to run on Jupyter notebook with a config file, but I get the following error message:

AttributeError: 'str' object has no attribute 'copy'

I use this kind of code: args = pyrallis.load(TrainConfig, "a.yaml")

Do you have any idea of using pyrallis on notebooks?

jakeoung commented 2 years ago

I've resolved the issue, by using args = pyrallis.load(TrainConfig, open("a.yaml", "r"))