Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to run 'usage in 15 minutes' example #9

Open
TheOnlylight opened this issue Mar 8, 2023 · 3 comments
Open

unable to run 'usage in 15 minutes' example #9

TheOnlylight opened this issue Mar 8, 2023 · 3 comments

Comments

@TheOnlylight
Copy link

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-3-8c9f93f73c07>](https://yucuju2ns5m-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230307-060233-RC01_514758488#) in <module>
      1 from ofasys import Task, Trainer, GeneralistModel
----> 2 task1 = Task(
      3     name='caption',
      4     instruction='[IMAGE:image_url] what does the image describe? -> [TEXT:caption]',
      5     micro_batch_size=4,

[/usr/local/lib/python3.9/dist-packages/ofasys/task/base.py](https://yucuju2ns5m-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230307-060233-RC01_514758488#) in __init__(self, cfg, **kwargs)
    205         self.cfg.update(**kwargs)
    206         self._generator = None
--> 207         self.diffuser_args = json.loads(cfg.diffuser_args)  # accessed by the diffusion criterion and generator
    208 
    209         self.datasets = {}

AttributeError: 'NoneType' object has no attribute 'diffuser_args'
@TheOnlylight
Copy link
Author

There is a bug in the pip installed version

the wrong one is :

        self.cfg = TaskConfig() if cfg is None else cfg
        self.cfg.update(**kwargs)
        self._generator = None
        self.diffuser_args = json.loads(cfg.diffuser_args)

cfg is just input para, the changed one is self.cfg.
Please change this in the pip version

@lllxf
Copy link

lllxf commented Feb 18, 2024

Can I solve this problem by install this lastest version:pip install -U http://ofasys.oss-cn-zhangjiakou.aliyuncs.com/pkg/ofasys-0.1.0-py3-none-any.whl?

@OguzCennet
Copy link

There is a bug in the pip installed version

the wrong one is :

        self.cfg = TaskConfig() if cfg is None else cfg
        self.cfg.update(**kwargs)
        self._generator = None
        self.diffuser_args = json.loads(cfg.diffuser_args)

cfg is just input para, the changed one is self.cfg. Please change this in the pip version

Which version actually we need to change this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants