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

Run pawsx task got "TypeError: 'NoneType' object cannot be interpreted as an integer" error. #1539

Open
weizhixiaoyi opened this issue Mar 7, 2024 · 2 comments
Labels
bug Something isn't working.

Comments

@weizhixiaoyi
Copy link

use the following command to run xstorycloze task, task is success. HF_MODEL_DIR is qwen model that saved in local machine.

lm_eval --model hf \
            --model_args pretrained=$HF_MODEL_DIR,trust_remote_code=True \
            --tasks xstorycloze \
            --device cuda:2 \
            --batch_size 8

however, use the following command to run pawsx task, got the following error:

lm_eval --model hf \
            --model_args pretrained=$HF_MODEL_DIR,trust_remote_code=True \
            --tasks pawsx \
            --device cuda:3
2024-03-07:17:36:01,211 INFO     [evaluator.py:190] get_task_dict has been updated to accept an optional argument, `task_manager`Read more here:https://github.com/EleutherAI/lm-evaluation-harness/blob/main/docs/interface.md#external-library-usage
2024-03-07:17:36:32,420 INFO     [task.py:395] Building contexts for paws_zh on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1294.27it/s]
2024-03-07:17:36:34,013 INFO     [task.py:395] Building contexts for paws_ko on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1299.46it/s]
2024-03-07:17:36:35,603 INFO     [task.py:395] Building contexts for paws_ja on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1295.99it/s]
2024-03-07:17:36:37,196 INFO     [task.py:395] Building contexts for paws_fr on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1304.71it/s]
2024-03-07:17:36:38,780 INFO     [task.py:395] Building contexts for paws_es on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1320.33it/s]
2024-03-07:17:36:40,347 INFO     [task.py:395] Building contexts for paws_en on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1319.51it/s]
2024-03-07:17:36:41,912 INFO     [task.py:395] Building contexts for paws_de on rank 0...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2000/2000 [00:01<00:00, 1171.38it/s]
2024-03-07:17:36:43,670 INFO     [evaluator.py:357] Running loglikelihood requests
Running loglikelihood requests:   0%|                                                                                                                                                                                                                                                       | 0/28000 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/usr/local/bin/lm_eval", line 8, in <module>
    sys.exit(cli_evaluate())
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/__main__.py", line 318, in cli_evaluate
    results = evaluator.simple_evaluate(
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/utils.py", line 288, in _wrapper
    return fn(*args, **kwargs)
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/evaluator.py", line 230, in simple_evaluate
    results = evaluate(
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/utils.py", line 288, in _wrapper
    return fn(*args, **kwargs)
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/evaluator.py", line 368, in evaluate
    resps = getattr(lm, reqtype)(cloned_reqs)
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/api/model.py", line 321, in loglikelihood
    return self._loglikelihood_tokens(new_reqs)
  File "/mnt/workspace/workgroup/wangzhenhai.wzh/codes/tars-cpt-eval/tools/lm-evaluation-harness/lm_eval/models/huggingface.py", line 958, in _loglikelihood_tokens
    inp = torch.tensor(
TypeError: 'NoneType' object cannot be interpreted as an integer
Running loglikelihood requests:   0%|
@haileyschoelkopf
Copy link
Collaborator

@lintangsutawika , you ported paws-x to yaml right? Have you observed this error?

@haileyschoelkopf haileyschoelkopf added the bug Something isn't working. label Mar 7, 2024
@lintangsutawika
Copy link
Contributor

Will have to check, I remember it running fine but that was a while back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants