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

SyntaxError when running demo.ipynb (seems like an error rise from gin) #15

Open
Sutongtong233 opened this issue Feb 28, 2024 · 0 comments

Comments

@Sutongtong233
Copy link

Hi, I am really interested in your work. I have some problems when running the demo.ipynb: when running block 2 in the notebook, # Load model and parameters, there is an error:

{
	"name": "SyntaxError",
	"message": "Expected '='. (base.gin, line 4)
  In file \"t5x/examples/unified_io/t5_1_1/xl.gin\", line 5
    include 't5x/examples/unified_io/t5_1_1/base.gin'  # imports vocab, optimizer and model.
  In file \"t5x/examples/unified_io/t5_1_1/xxl.gin\", line 5
    include 't5x/examples/unified_io/t5_1_1/xl.gin'  # imports vocab, optimizer and model.",
	"stack": "Traceback (most recent call last):

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/IPython/core/interactiveshell.py:3550 in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  Cell In[12], line 13
    model = uio_utils.get_model(MODEL_TYPE, dtype=\"bfloat16\" if supports_bfloat16 else \"float32\")

  File /mnt/workspace/tongtong.stt/unisd_baselines/unified-io-2/t5x/examples/unified_io/utils.py:51 in get_model
    gin.parse_config_files_and_bindings(

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1470 in parse_config_files_and_bindings
    parse_config_file(config_file, skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1436 in parse_config_file
    parse_config(f, skip_unknown=skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1377 in parse_config
    parse_config_file(statement.filename, skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/contextlib.py:135 in __exit__
    self.gen.throw(type, value, traceback)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/utils.py:67 in try_with_location
    augment_exception_message_and_reraise(exception, _format_location(location))

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/utils.py:48 in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)

  File <string>:3 in raise_from

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/utils.py:65 in try_with_location
    yield

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1377 in parse_config
    parse_config_file(statement.filename, skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1436 in parse_config_file
    parse_config(f, skip_unknown=skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1377 in parse_config
    parse_config_file(statement.filename, skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/contextlib.py:135 in __exit__
    self.gen.throw(type, value, traceback)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/utils.py:67 in try_with_location
    augment_exception_message_and_reraise(exception, _format_location(location))

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/utils.py:48 in augment_exception_message_and_reraise
    six.raise_from(proxy.with_traceback(exception.__traceback__), None)

  File <string>:3 in raise_from

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/utils.py:65 in try_with_location
    yield

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1377 in parse_config
    parse_config_file(statement.filename, skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1436 in parse_config_file
    parse_config(f, skip_unknown=skip_unknown)

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config.py:1352 in parse_config
    for statement in parser:

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config_parser.py:172 in __next__
    return self.next()

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config_parser.py:175 in next
    statement = self.parse_statement()

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config_parser.py:206 in parse_statement
    self._raise_syntax_error(\"Expected '='.\")

  File /opt/conda/envs/unifiedIO/lib/python3.9/site-packages/gin/config_parser.py:267 in _raise_syntax_error
    raise SyntaxError(msg, location)

  File <string>
SyntaxError
"
}

Seems like an error rise from gin module. gin module is not necessary for inference. Is there any more concise code? Thanks

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

1 participant