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
Is your feature request related to a problem? Please describe.
Integrate outlines to generate structured outputs from LLMs.
Describe the solution you'd like
I would like to generate structured outputs from the LLMs. Ideally, we should generate json as simple as text using other frameworks:
frompydanticimportBaseModelfromdistilabel.llmsimportTransformersLLM# Example from outlines docsclassUser(BaseModel):
name: strlast_name: strid: intllm=TransformersLLM(
model="argilla/notus-7b-v1",
structured_output={"format": "json", "structure": User},
)
llm.load()
result=llm.generate(
[
[{"role": "user", "content": "Create a user profile with the fields name, last_name and id"}]
],
max_new_tokens=30
)
print(result)
# [[{"name": "John", "last_name": "Doe", "id": 11}]]
Describe alternatives you've considered
Not generating structured output.
Is your feature request related to a problem? Please describe.
Integrate
outlines
to generate structured outputs from LLMs.Describe the solution you'd like
I would like to generate structured outputs from the
LLMs
. Ideally, we should generate json as simple as text using other frameworks:Describe alternatives you've considered
Not generating structured output.
Additional context
We can start with
outlines
but other candidates areinstructor
andguidance
.The text was updated successfully, but these errors were encountered: