8000 Truncated Output on String Properties · Issue #60 · 1rgs/jsonformer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Truncated Output on String Properties #60
Open
@VolodymyrBiryuk

Description

@VolodymyrBiryuk

I have an issue with truncated output in the objectid property. When I execute the generation it only returns 11 characters. Is the number of characters limited for strings? The model is mistralai/Mistral-7B-Instruct-v0.3. I provide a minimal example below.

Minimal example:

json_schema = {
    'type': 'object',
    'properties': {
        'objectid': {'type': 'string'},
        'type': {
            'type': 'array',
            'items': {'type': 'string'},
        }
    }
}

prompt = '''Determine the type of this review in the content property. Possible value are "complaint", "praise".

###
{
    "objectid": "674f3f9df09d1cb1ddc55212",
    "content": "I hate this company",
}
###
'''

jsonformer = Jsonformer(
    model,
    tokenizer,
    json_schema,
    prompt,
)
generated_data = jsonformer()

print(generated_data)

Result:
{'objectid': '674f3f9df09', 'type': ['complaint']}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0