Skip to content

[PROBLEM]  #1270

Open
Open
@jeisner

Description

@jeisner

Identify the file to be fixed
examples/Chat_finetuning_data_prep.ipynb

Describe the problem
Raises exception if the fine-tuning messages include "weight" keys.

Describe a solution
The problem is here:

for key, value in message.items():
    num_tokens += len(encoding.encode(value))

If key=='weight', you should not call encode(value), because value should be numeric.
(You may want to check that value is numeric and indeed that value in [0,1], which is all that is supported now, at least according to OpenAI's documentation.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions