Hello,
I am trying to fine-tune the google-bert/bert-base-uncased model with the lhoestq/squad dataset as shown in the documentation for an example of Extraction Question and Answering which is shown in the link below:
I have set up my autotrain UI exactly as shown in the screen shot in the above link. I have checked that I have the correct column names. I have tried running this with a CPU and the small T4. However, in both cases I get the following errors:
Device 0: Tesla T4 - 2.88MiB/15360MiB
INFO | 2025-05-31 16:58:27 | autotrain.app.utils:kill_process_by_pid:90 - Sent SIGTERM to process with PID 65
INFO | 2025-05-31 16:58:27 | autotrain.app.utils:get_running_jobs:40 - Killing PID: 65
subprocess.CalledProcessError: Command ‘[’/app/env/bin/python’, ‘-m’, ‘autotrain.trainers.extractive_question_answering’, ‘–training_config’, ‘autotrain-vfbpf-ju79s/training_params.json’]’ returned non-zero exit status 1.
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
File “/app/env/lib/python3.10/site-packages/accelerate/commands/launch.py”, line 763, in simple_launcher
simple_launcher(args)
File “/app/env/lib/python3.10/site-packages/accelerate/commands/launch.py”, line 1168, in launch_command
args.func(args)
File “/app/env/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py”, line 48, in main
sys.exit(main())
File “/app/env/bin/accelerate”, line 8, in
Traceback (most recent call last):
ImportError: cannot import name ‘load_metric’ from ‘datasets’ (/app/env/lib/python3.10/site-packages/datasets/init.py)
from datasets import load_metric
File “/app/env/lib/python3.10/site-packages/autotrain/trainers/extractive_question_answering/utils.py”, line 6, in
from autotrain.trainers.extractive_question_answering import utils
File “/app/env/lib/python3.10/site-packages/autotrain/trainers/extractive_question_answering/main.py”, line 30, in
exec(code, run_globals)
File “/app/env/lib/python3.10/runpy.py”, line 86, in _run_code
return _run_code(code, main_globals, None,
File “/app/env/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
Traceback (most recent call last):
To avoid this warning pass in values for each of the problematic parameters or run accelerate config.
--dynamo_backend was set to a value of 'no'
The following values were not passed to accelerate launch and had defaults used instead:
INFO | 2025-05-31 16:58:15 | autotrain.backends.local:create:25 - Training PID: 65
INFO | 2025-05-31 16:58:15 | autotrain.commands:launch_command:515 - {‘data_path’: ‘lhoestq/squad’, ‘model’: ‘google-bert/bert-base-uncased’, ‘lr’: 5e-05, ‘epochs’: 3, ‘max_seq_length’: 512, ‘max_doc_stride’: 128, ‘batch_size’: 8, ‘warmup_ratio’: 0.1, ‘gradient_accumulation’: 1, ‘optimizer’: ‘adamw_torch’, ‘scheduler’: ‘linear’, ‘weight_decay’: 0.0, ‘max_grad_norm’: 1.0, ‘seed’: 42, ‘train_split’: ‘train’, ‘valid_split’: ‘validation’, ‘text_column’: ‘context’, ‘question_column’: ‘question’, ‘answer_column’: ‘answers’, ‘logging_steps’: -1, ‘project_name’: ‘autotrain-vfbpf-ju79s’, ‘auto_find_batch_size’: False, ‘mixed_precision’: ‘fp16’, ‘save_total_limit’: 1, ‘token’: ‘*****’, ‘push_to_hub’: True, ‘eval_strategy’: ‘epoch’, ‘username’: ‘ianmd’, ‘log’: ‘tensorboard’, ‘early_stopping_patience’: 5, ‘early_stopping_threshold’: 0.01}
INFO | 2025-05-31 16:58:15 | autotrain.commands:launch_command:514 - [‘accelerate’, ‘launch’, ‘–num_machines’, ‘1’, ‘–num_processes’, ‘1’, ‘–mixed_precision’, ‘fp16’, ‘-m’, ‘autotrain.trainers.extractive_question_answering’, ‘–training_config’, ‘autotrain-vfbpf-ju79s/training_params.json’]
INFO | 2025-05-31 16:58:15 | autotrain.backends.local:create:20 - Starting local training…
INFO | 2025-05-31 16:58:15 | autotrain.app.ui_routes:handle_form:540 - hardware: local-ui
INFO | 2025-05-31 16:56:38 | autotrain.app.ui_routes:fetch_params:415 - Task: extractive-qa
INFO | 2025-05-31 16:56:27 | autotrain.app.ui_routes:fetch_params:415 - Task: llm:sft
INFO: 10.16.19.229:12486 - “GET /?__sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2N2VlNTdmZDM1NDdmODIzMTAyNTI5M2MiLCJ1c2VyIjoiaWFubWQiLCJzZXNzaW9uSWQiOiI2ODNhY2NkMjFhYjk5N2VlMjZkZThjZjkifSwiaWF0IjoxNzQ4NzEwNTg2LCJzdWIiOiIvc3BhY2VzL2lhbm1kL2F1dG90cmFpbi10ZXN0aW5nIiwiZXhwIjoxNzQ4Nzk2OTg2LCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.sExea1b6OSWrCBCUfS_3I9DmYqaIclQC9dNG4pukT00UNEB_2x8uq3bt-Culu03y-zIoAfhT94RQR_IAEfwxCw HTTP/1.1” 307 Temporary Redirect
INFO: 10.16.19.229:12486 - “GET /?__sign=eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sIm9uQmVoYWxmT2YiOnsia2luZCI6InVzZXIiLCJfaWQiOiI2N2VlNTdmZDM1NDdmODIzMTAyNTI5M2MiLCJ1c2VyIjoiaWFubWQiLCJzZXNzaW9uSWQiOiI2ODNhY2NkMjFhYjk5N2VlMjZkZThjZjkifSwiaWF0IjoxNzQ4NzEwNTg2LCJzdWIiOiIvc3BhY2VzL2lhbm1kL2F1dG90cmFpbi10ZXN0aW5nIiwiZXhwIjoxNzQ4Nzk2OTg2LCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.sExea1b6OSWrCBCUfS_3I9DmYqaIclQC9dNG4pukT00UNEB_2x8uq3bt-Culu03y-zIoAfhT94RQR_IAEfwxCw HTTP/1.1” 307 Temporary Redirect
INFO: Uvicorn running on http://0.0.0.0:7860 (Press CTRL+C to quit)
INFO: Application startup complete.
INFO: Waiting for application startup.
INFO: Started server process [49]
INFO | 2025-05-31 16:54:20 | autotrain.app.app::24 - AutoTrain started successfully
INFO | 2025-05-31 16:54:20 | autotrain.app.app::23 - AutoTrain version: 0.8.36
INFO | 2025-05-31 16:54:20 | autotrain.app.app::13 - Starting AutoTrain…
INFO | 2025-05-31 16:54:20 | autotrain.app.ui_routes::315 - AutoTrain started successfully
INFO | 2025-05-31 16:54:18 | autotrain.app.ui_routes::31 - Starting AutoTrain…
I have also tried other QA datasets from Huggingface but get the same errors. I have tried fine-tuning a text_classification model and everything is fine using a CPU. I have spent hours trying to figure this out and have searched online for why this is happening. The load_metric appears to be problematic but I do not understand why I should be getting this given it is exactly the same as the example given in the documentation (although I do not know what processor was being used.
Has anyone had a similar issue? I would appreciate any pointers on this.
Thanks very much
ian


