Comments (3)
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.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
from transformers.
Related Issues (20)
- SwinLayer / DonutSwinLayer / ClapAudioLayer attention mask creation always happens on CPU HOT 1
- AutoModelForCausalLM.from_pretrained silently fails HOT 2
- Galore finetuning #stopped HOT 5
- [GGUF] Support new architectures/ quantisation schemes in Transformers HOT 1
- Language modeling examples do not show how to do multi-gpu training / fine-tuning HOT 8
- Using a single 'RecurrentGemmaRglru' layer - "Trying to backward through the graph a second time" Error
- `MixtralFlashAttention2` subscripts `position_ids` before checking if it is `None` HOT 2
- llava-next, any resolution bug? HOT 4
- `model_kwargs` is None when `generation_config` is passed as a dict instead of `generation.GenerationConfig` HOT 2
- Can't do fine-tuning on Colab HOT 4
- special token `<s>` conflicts with html tag `<s>` HOT 2
- Ability to split special tokens with fast tokenizer HOT 1
- Support saving models trained with DeepSpeed in Trainer callbacks HOT 1
- Implementation Issue of Phi3SuScaledRotaryEmbedding HOT 1
- Seq TransfoRNA HOT 2
- convert_data2vec_audio_original_pytorch_checkpoint_to_pytorch.py works for data2vec 1.0 checkpoint but not data2vec 2.0
- convert_data2vec_audio_original_pytorch_checkpoint_to_pytorch.py works for data2vec 2.0 AttributeError: 'ModuleList' object has no attribute 'mlp' HOT 1
- AttributeError: 'NllbTokenizerFast' object has no attribute 'lang_code_to_id' HOT 3
- Low retrieval and generation performance if evaluate rag model using consolidate_rag_checkpoint initialized with BART-LARGE as generator
- [CI] 2 Cohere tests are failing and skipped for now HOT 1
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.