Comments (2)
I have not tested it enough to trust that it is a safe solution but what I ended up doing to fix this issue was to go to beam_search.py and slice the token_ids list in all calls to reset(), so that it does not include the prompt.
from transformers.
Hi @esaks1 👋 Thank you for opening this issue!
Constrained generation is indeed not being actively maintained due to lack of bandwidth -- it deserves a proper dive at some point in the future.
Meanwhile, I'd like to suggest the following workarounds:
- If your constraints are structured, i.e. you know the shape of your desired LLM output, have a look at this library: https://github.com/outlines-dev/outlines
- If you simply want to fit certain words in the answer, you may consider passing
sequence_bias
to make those words more likely. If they become too repetitive withsequence_bias
, you should be able to avoid repetitions withrepetition_penalty
(full docs)
from transformers.
Related Issues (20)
- Bug with train class method for MobileViTForSemanticSegmentation HOT 2
- Starcoder2 has +10% inference latency when flash attention 2 is enabled HOT 2
- CLIP Training Example Bug - Overfitting HOT 1
- `PreTrainedTokenizerFast._batch_encode_plus()` got an unexpected keyword argument `'split_special_tokens'` HOT 3
- Cannot save HQQ quantized model. HOT 6
- LLama-3 8B - can't match MMLU performance HOT 2
- Pure Python `PreTrainedTokenizer` is Broken HOT 1
- Construct a Marian tokenizer. Based on huggingface tokenizers HOT 2
- DDP error with load_best_model_at_end enabled
- Error while moving model to GPU `NotImplementedError: Cannot copy out of meta tensor; no data!` HOT 4
- KV cache with CPU offloading HOT 4
- Refusal rejection removal as a feature
- Add static cache support for Whisper HOT 3
- from_pretrained torch_dtype DO NOT affect model buffers
- Error with tf-keras when trying to geneate random seeds HOT 1
- Error while runing T5 trainer: TypeError: argument 'ids': 'list' object cannot be interpreted as an integer HOT 2
- Is `model. generate` supported during the training process?
- CLIPProcessor is not loading the saved Processor of the same version HOT 12
- Failed to Download GPT2-large Model from Hub
- Add TableTransformerImageProcessor HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transformers.