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

report: "ValueError: Batch does not contain any data (None)." when streaming=True #3286

Open
2 of 4 tasks
holyYodu opened this issue Dec 10, 2024 · 0 comments
Open
2 of 4 tasks

Comments

@holyYodu
Copy link

holyYodu commented Dec 10, 2024

System Info

- `Accelerate` version: 0.21.0
- Platform: Linux-3.10.0-1160.119.1.el7.x86_64-x86_64-with-glibc2.17
- Python version: 3.11.0
- Numpy version: 1.26.4
- PyTorch version (GPU?): 2.5.1+cu124 (True)
- PyTorch XPU available: False
- PyTorch NPU available: False
- System RAM: 62.92 GB
- GPU type: NVIDIA A10
- `Accelerate` default config:
        Not found

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • One of the scripts in the examples/ folder of Accelerate or an officially supported no_trainer script in the examples folder of the transformers repo (such as run_no_trainer_glue.py)
  • My own task or dataset (give details below)

Reproduction

from datasets import load_dataset
from transformers import AutoTokenizer

from uniem.finetuner import FineTuner
from uniem.model import create_uniem_embedder

dataset = load_dataset('shibing624/nli-zh-all', streaming=True)
dataset = dataset.rename_columns({'text1': 'sentence1', 'text2': 'sentence2'})

# 由于是从头训练,我们需要自己初始化 embedder 和 tokenizer。当然,我们也可以选择新的 pooling 策略。
embedder = create_uniem_embedder('uer/chinese_roberta_L-2_H-128', pooling_strategy='cls')
tokenizer = AutoTokenizer.from_pretrained('uer/chinese_roberta_L-2_H-128')

finetuner = FineTuner(embedder, tokenizer=tokenizer, dataset=dataset)
fintuned_model = finetuner.run(epochs=3, batch_size=32, lr=1e-3)

Expected behavior

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