When I run
instruction = "You are an expert radiographer. Describe accurately what you see in this image."
def convert_to_conversation(sample):
conversation = [
{ "role": "user",
"content" : [
{"type" : "text", "text" : instruction},
{"type" : "image", "image" : sample["image"]} ]
},
{ "role" : "assistant",
"content" : [
{"type" : "text", "text" : sample["caption"]} ]
},
]
return { "messages" : conversation }
pass
then
converted_dataset = [convert_to_conversation(sample) for sample in dataset]
I get this error
NameError Traceback (most recent call last)
<ipython-input-4-a32c10305d17> in <cell line: 1>()
----> 1 converted_dataset = [convert_to_conversation(sample) for sample in dataset]
NameError: name 'dataset' is not defined
I have no idea how to fix it.