Eladlev / AutoPrompt

A framework for prompt tuning using Intent-based Prompt Calibration
Apache License 2.0
1.86k stars 149 forks source link

KeyError: 'samples' #43

Closed alibabadoufu closed 3 months ago

alibabadoufu commented 4 months ago

Output of the sample_batches doesn't have the sample keys

        samples_list = [
            element for sublist in samples_batches for element in sublist["samples"]
        ]

Reference: https://github.com/Eladlev/AutoPrompt/blob/c640cc0108e78601b474b380462a1a6274318fcc/optimization_pipeline.py#L192C25-L192C32

Eladlev commented 4 months ago

Could you provide the exact configuration? In which mode did you try to run the code?

alibabadoufu commented 4 months ago

Could you provide the exact configuration? In which mode did you try to run the code?

Hi, I am using huggingfacepipeline.

Referring to the screenshot below, the all_results doesn't contain the key "samples"

image

Eladlev commented 4 months ago

When working with huggingfacepipeline you should change the meta prompts to the completion format in the config_default file (the default meta prompts are using openAI functions):

meta_prompts:
    folder: 'prompts/meta_prompts_completion'