Coder Social home page Coder Social logo

Comments (18)

joncamgui avatar joncamgui commented on May 26, 2024 2

Thanks a lot @ricardorei . It works perfectly!

from comet.

i-am-nika avatar i-am-nika commented on May 26, 2024 2

It still doesn't work for Python 3.8...

from comet.

mjpost avatar mjpost commented on May 26, 2024 1

Yes, it works (with a few command-line parameter changes). Thank you!

from comet.

FayeXXX avatar FayeXXX commented on May 26, 2024 1

@AnanyaCoder
the same error occours in my python3.7 env, have you figured it out?

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

Is there any plan to make it work for python 3.8?

Yes, I already tested it before in python 3.8 and 3.9. It should support python 3.6, 3.7, 3.8, and 3.9. I'll take a look at it tomorrow. It is probably just a reqs/dependency problem...

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

Btw does the command: comet-score -s src.de -t hyp.en -r ref.en work?

from comet.

ShivaliGoel avatar ShivaliGoel commented on May 26, 2024

Hi, I had the same issue. I switched to Python 3.7 and pandas==1.1.5 to make it work for me. (Installed from pip & running locally- no GPU)

from comet.

joncamgui avatar joncamgui commented on May 26, 2024

Btw does the command: comet-score -s src.de -t hyp.en -r ref.en work?

It does not work either. I get:

File "/usr/local/Cellar/[email protected]/3.8.12/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'CometModel.predict.<locals>.<lambda>'

from comet.

ShivaliGoel avatar ShivaliGoel commented on May 26, 2024

@joncamgui I got the same error but using 3.7 and pandas==1.1.5 resolved it.

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

I found the error.

I believe during Inference Pytorch Lightning will create model copies and it will complain about the fact that there is a lambda function defines locally: https://github.com/Unbabel/COMET/blob/master/comet/models/base.py#L445

After fixing that error it will complain about the local definition of PredictProgressBar.

I am just wondering why it works for some python versions and not for others.

from comet.

mjpost avatar mjpost commented on May 26, 2024

I also have an issue with Python 3.8:

$ python3 -V
3.8.10
$ pip list | grep comet
unbabel-comet          0.1.0
$ comet score --model wmt-large-da-estimator-1719 [...]
Traceback (most recent call last):
  File "/usr/local/bin/comet", line 8, in <module>
    sys.exit(comet())
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/comet/cli.py", line 133, in score
    model = load_checkpoint(model) if os.path.exists(model) else download_model(model)
  File "/usr/local/lib/python3.8/dist-packages/comet/models/__init__.py", line 98, in download_model
    return load_checkpoint(checkpoint_path)
  File "/usr/local/lib/python3.8/dist-packages/comet/models/__init__.py", line 131, in load_checkpoint
    model = str2model[hparams["model"]].load_from_checkpoint(
  File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/core/saving.py", line 157, in load_from_checkpoint
    model = cls._load_model_state(checkpoint, strict=strict, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/pytorch_lightning/core/saving.py", line 199, in _load_model_state
    model = cls(**_cls_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/comet/models/estimators/comet_estimator.py", line 35, in __init__
    super().__init__(hparams)
  File "/usr/local/lib/python3.8/dist-packages/comet/models/estimators/estimator_base.py", line 70, in __init__
    super().__init__(hparams)
  File "/usr/local/lib/python3.8/dist-packages/comet/models/model_base.py", line 134, in __init__
    self.hparams = Namespace(**hparams)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 819, in __setattr__
    object.__setattr__(self, name, value)
AttributeError: can't set attribute

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

Hi @mjpost can you test it using the pre-release version?

pip install unbabel-comet==1.0.0rc8

I fixed some of the problems reported on this thread already.

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

@joncamgui please test it now: pip install unbabel-comet==1.0.0rc8
I fixed the error you reported already

from comet.

WilliamTambellini avatar WilliamTambellini commented on May 26, 2024

Hi @ricardorei
Any plan to make the official 1.0 available in standard 3.8 pip:

pip3.8 install unbabel-comet==1.0.0
ERROR: Could not find a version that satisfies the requirement unbabel-comet==1.0.0 (from versions: 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.6, 0.0.6.post1, 0.0.6.post2, 0.0.7, 0.1.0, 1.0.0rc1, 1.0.0rc2, 1.0.0rc3, 1.0.0rc4, 1.0.0rc5, 1.0.0rc6, 1.0.0rc7, 1.0.0rc8, 1.0.0rc9)
ERROR: No matching distribution found for unbabel-comet==1.0.0

Best
W.

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

@WilliamTambellini I release version 1.0 a few hours ago and I tested it on python 3.8. As you can see your pip should return you 1.0.0 and 1.0.1 versions

The install test for python 3.8 can be seen here.

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

have you tried to upgrade pip?

from comet.

ricardorei avatar ricardorei commented on May 26, 2024

I am reopening this until its fixed.

from comet.

AnanyaCoder avatar AnanyaCoder commented on May 26, 2024

ImportError Traceback (most recent call last)
/tmp/ipykernel_33/376669550.py in
----> 1 from comet import download_model, load_from_checkpoint
2 import os
3 import sys
4 #from comet.models import download_model
5 #Load COMET Models before hand

ImportError: cannot import name 'download_model' from 'comet' (/opt/conda/lib/python3.7/site-packages/comet/init.py)

from comet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.