thomaslu2000 / Incremental-Parsing-Representations

MIT License
57 stars 4 forks source link

Invalid syntax #3

Closed allanj closed 2 years ago

allanj commented 2 years ago

I think I ran into some errors (though using the packages with the same version)

Traceback (most recent call last):
  File "src/main.py", line 16, in <module>
    from benepar import parse_chart
  File "/root/Incremental-Parsing-Representations/src/benepar/parse_chart.py", line 23, in <module>
    from . import subbatching
  File "/root/Incremental-Parsing-Representations/src/benepar/subbatching.py", line 34
    yield subbatch_item_ids, *[
                             ^
SyntaxError: invalid syntax

Probably happened in here: https://github.com/thomaslu2000/Incremental-Parsing-Representations/blob/main/src/benepar/subbatching.py#L33-L37

while costs_argsort:
    if subbatch_size == len(costs_argsort) or (
        subbatch_size * costs[costs_argsort[subbatch_size]] > max_cost
    ):
        subbatch_item_ids = costs_argsort[:subbatch_size]
        yield subbatch_item_ids, *[
            [items[i] for i in subbatch_item_ids] for items in data
        ]
        costs_argsort = costs_argsort[subbatch_size:]
        subbatch_size = 1
    else:
        subbatch_size += 1
thomaslu2000 commented 2 years ago

We think this is due to tuple unpacking being unsupported in older versions of Python. We updated our codebase to avoid this syntax.

Thanks for letting us know!