You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What behavior of the library made you think about the improvement?
It might be nice to have the option to have a non_strict mode when doing generations for large batches of data. This could be particularly helpful for creating synthetic data where you usually don't care too much about skipping some prompts but do care about having failures to a computationally expensive pipeline.
Currently, when using a generator constructed using a JSON Schema/Pydantic Class, i.e.
It is currently possible to attempt to fix this using different whitespace patterns, increasing best_of values or using a different LLM.
This approach to addressing the issue works okay if the error occurs regularly, but it's a bit annoying if you process large amounts of prompts and only get the error late. One approach you can take now is to manage the generation in smaller batches with a try/except block and either reattempt the failed batch or skip it.
How would you like it to behave?
It might be nice instead to have an option flag to manage some exceptions when calling the generator and returning None for the failed generations, i.e.
I am not very familiar with Outlines' internals, and I do not know how feasible it is to add this across all the LLM engines currently supported. This option would obviously make sense to be off by default, but IMO, it could be useful for some workloads where you care about the generations being correct but don't mind too much if one or two prompts result in None being generated.
I couldn't find anything proposing this before (I might have missed an issue, but some other related issues: #759 #612
The text was updated successfully, but these errors were encountered:
I can second the need for this feature! Maybe it would be possible to fix by in the backend setting a pydantic type_adapter that can choose between Union[YourModel,None], so basically if the input data doesn't validate, it will return None (or str, or whatever).
What behavior of the library made you think about the improvement?
It might be nice to have the option to have a
non_strict
mode when doing generations for large batches of data. This could be particularly helpful for creating synthetic data where you usually don't care too much about skipping some prompts but do care about having failures to a computationally expensive pipeline.Currently, when using a generator constructed using a JSON Schema/Pydantic Class, i.e.
and calling the generator
I am running into
JSONDecodeError
errors with the source being aValidationError
for an Unterminated string.It is currently possible to attempt to fix this using different whitespace patterns, increasing
best_of
values or using a different LLM.This approach to addressing the issue works okay if the error occurs regularly, but it's a bit annoying if you process large amounts of prompts and only get the error late. One approach you can take now is to manage the generation in smaller batches with a try/except block and either reattempt the failed batch or skip it.
How would you like it to behave?
It might be nice instead to have an option flag to manage some exceptions when calling the generator and returning
None
for the failed generations, i.e.Which would return something like:
I am not very familiar with Outlines' internals, and I do not know how feasible it is to add this across all the LLM engines currently supported. This option would obviously make sense to be off by default, but IMO, it could be useful for some workloads where you care about the generations being correct but don't mind too much if one or two prompts result in
None
being generated.I couldn't find anything proposing this before (I might have missed an issue, but some other related issues:
#759
#612
The text was updated successfully, but these errors were encountered: