Flax-community/koclip error
I followed the below instructions, but I still got the same error.github.com/huggingface/transformers[Flax] Fix hybrid cliphuggingface:master←patil-suraj:fix-hybrid-clipopened07:00PM - 05 Jul 21 UTCpatil-suraj+127-16# What does this PR do?

This PR fixes an issue with saving and loading `Hybri…dCLIPConfig` which was causing issues when loading the model.

The config was expecting the `text_config_dict` and `vision_config_dict` arguments, but in the `to_dict` it was saved as `text_config` and `vision_config`. So the next time when `config` was loaded using `from_pretrained` the `model_type` key was missing from `text_config_dict` and `vision_config_dict` as we pop that in the init.

This PR renames `text_config_dict` and `vision_config_dict` to `text_config` and `vision_config` respectively. This is slightly breaking as we won't be able to load previously saved configs. A simple workaround for that is to re-initialize the config using
`from_text_vision_configs` method and resave them.

This PR also adds some usage examples for `FlaxHybridCLIP`.

Fixes #12513

(I should really add tests for this)This is colab link. I get the same errorcolab.research.google.comGoogle ColaboratoryTypeError: __init__() got an unexpected keyword argument '_do_init'
Traceback:
File "/home/user/.local/lib/python3.8/site-packages/streamlit/scriptrunner/script_runner.py", line 554, in _run_script
    exec(code, module.__dict__)
File "/home/user/app/app.py", line 20, in <module>
    PAGES[page].app(model)
File "/home/user/app/text2image.py", line 15, in app
    model, processor = load_model(f"koclip/{model_name}")
File "/home/user/app/utils.py", line 49, in load_model
    cached_model = load_model_cached(model_name)
File "/home/user/.local/lib/python3.8/site-packages/streamlit/legacy_caching/caching.py", line 573, in wrapped_func
    return get_or_create_cached_value()
File "/home/user/.local/lib/python3.8/site-packages/streamlit/legacy_caching/caching.py", line 557, in get_or_create_cached_value
    return_value = func(*args, **kwargs)
File "/home/user/app/utils.py", line 58, in load_model_cached
    model = FlaxHybridCLIP.from_pretrained(model_name)
File "/home/user/.local/lib/python3.8/site-packages/transformers/modeling_flax_utils.py", line 784, in from_pretrained
    model = cls(config, *model_args, _do_init=_do_init, **model_kwargs)
File "/home/user/app/koclip/model.py", line 161, in __init__
    module = self.module_class(config=config, dtype=dtype, **kwargs)image787×585 10.2 KB