clinicalml / TabLLM

MIT License
265 stars 42 forks source link

yaml template custom tag #9

Open 0Frett opened 1 year ago

0Frett commented 1 year ago

Hi the yaml template has two custom tag, which are !Template and !Meta. When I use fulloader, the loader can't recognize the two custom tags and report constructor error. However, I didn't find file or function relevant to the constructor definition. Thanks!

stefanhgm commented 11 months ago

Hello @0Frett ,

sorry for the late reply and thanks for using our code and reaching out!

I remember that I had a similar issue. The yaml template comes from the promptsource framework. Maybe its already enough to add the following imports:

from promptsource.templates import DatasetTemplates, Template

And just to be sure: are you loading the templates like in our code:

# Load template
yaml_dict = yaml.load(open('/root/TabLLM/templates/templates_' + task + '.yaml', "r"), Loader=yaml.FullLoader)
prompts = yaml_dict['templates']

Let us know if you need any further help!