Pinned content
View all 2 collectionsNLP admins have deemed these posts noteworthy.
Natural Language Processing FAQ
Can you answer these questions?
View all unanswered questionsThese questions still don't have an answer
IndexError: index -1 is out of bounds for dimension 0 with size 0
Inconsistent name normalization when extracting data using OpenAI API (gpt-4.0-mini)
Transformers 'could not import module pipeline' to jupyter notebook
Transformers with Python 3.12.3 produce lots of errors
Torch example transformer with TransformerDecoder
Recommended answers
View all recommended answersThese answers have been recommended
Removing strange/special characters from outputs llama 3.1 model
TL;DR Use this instead of rolling out your own detokenizer. tokenizer.batch_decode(input_ids) In Long The official Llama 3.1 has some approval process that might take some time, so this answer will ...
Error while converting google flan T5 model to onnx
Use https://huggingface.co/datasets/bakks/flan-t5-onnx instead. And to convert the google/flan-t5, see https://huggingface.co/datasets/bakks/flan-t5-onnx/blob/main/exportt5.py from pathlib import ...
Why did my fine-tuning T5-Base Model for a sequence-to-sequence task has short incomplete generation?
Because of: labels = tokenizer(targets, max_length=32, padding="max_length", truncation=True) Most probably your model has learnt to just output/generate outputs that are ~32 tokens. Try: ...
How to save the LLM2Vec model as a HuggingFace PreTrainedModel object?
Wrapping the LLM2Vec object around like in https://stackoverflow.com/a/74109727/610569 We can try this: import torch.nn as nn from transformers import PreTrainedModel, PretrainedConfig from ...
Mistral model generates the same embeddings for different input texts
You're not slicing it the dimensions right at outputs.last_hidden_state[0, 0, :].numpy() Q: What is the 0th token in all inputs? A: Beginning of sentence token (BOS) Q: So that's the "embeddings&...
See what's trending
View all trending questionsThese are the most active questions in NLP Collective
How does the Google "Did you mean?" Algorithm work? [closed]
spaCy: Can't find model 'en_core_web_sm' on windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)
What is "entropy and information gain"? [closed]
How to compute the similarity between two text documents?
googletrans stopped working with error 'NoneType' object has no attribute 'group'
Simply submit a proposal, get it approved, and publish it.
See how the process works