notebooks icon indicating copy to clipboard operation
notebooks copied to clipboard

Notebooks using the Hugging Face libraries 🤗

Results 143 notebooks issues
Sort by recently updated
recently updated
newest added
trafficstars

The code snippet needs a correction in the line: labels["input_ids"][i] = [-100] * (max_length - len(sample_input_ids)) + label_input_ids Change it to: labels["input_ids"][i] = [-100] * (max_length - len(label_input_ids)) + label_input_ids...

Hi, recently I fine tune idefics model with peft. I am not able to load the model. Is there any way to load the model with peft back for inference?

trainer.train() File "E:\PycharmProjects\demo\venv\lib\site-packages\torch\nn\functional.py", line 3029, in cross_entropy return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing) RuntimeError: expected scalar type Long but found Int

The link [here](https://github.com/huggingface/notebooks/blob/382ef1c0906608b3a22955baa5d3c3ed61ae7067/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb#L192C219-L192C302) is broken and probably should be https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering

In this demo notebook [hete](examples/segment_anything.ipynb) the call `inputs = processor(raw_image, input_boxes=input_boxes, return_tensors="pt").to(device)` raises the error: `ValueError("Input boxes must be a list of list of list of floating points.")` `input boxes`...

# What does this PR do? The original notebook doesn't work out of the box. After the following fixes, it works. Fixes - updated diffusers[training] version to the 0.27.2 -...

The link [here](https://github.com/huggingface/notebooks/blob/main/diffusers_doc/en/pytorch/using_peft_for_inference.ipynb) is broken and I can not find similar notebook in [using_peft_for_inference.ipynb](https://github.com/huggingface/notebooks/tree/main/diffusers_doc/en/pytorch)

Issue found while running the colab today. Fixes # [(480)](https://github.com/huggingface/notebooks/issues/480)

Collision with `datasets` import created by the following assignment statement. ```python datasets = load_dataset("conll2003") ... tokenized_datasets = datasets.map(tokenize_and_align_labels, batched=True) ... train_set = model.prepare_tf_dataset( tokenized_datasets["train"], shuffle=True, batch_size=batch_size, collate_fn=data_collator, ) "TFDistilBertForTokenClassification requires...

running this cell in colab ``` from transformers import TrainingArguments training_args = TrainingArguments("test-trainer") ``` results in the error ``` --------------------------------------------------------------------------- ImportError Traceback (most recent call last) [](https://localhost:8080/#) in () 1...