caikit / caikit-nlp

Apache License 2.0
12 stars 45 forks source link

Error bootstrapping model shown in example #349

Open devpramod opened 4 months ago

devpramod commented 4 months ago

I get the following error when I try to run the bootstrapping code shown in the example that uses google/flan-t5-small

<function register_backend_type at 0x7f14529c7130> is still in the BETA phase and subject to change!
Exception ignored in: <function TextGeneration.__del__ at 0x7f12f291b880>
Traceback (most recent call last):
  File "/home/pramod/projects/embeddings_server/wrapped_sentence_transformer/PR/caikit-nlp/caikit_nlp/modules/text_generation/text_generation_local.py", line 120, in __del__
TypeError: 'NoneType' object is not callable

Code snippet used:

import os
# The env var ALLOW_DOWNLOADS has to be set to allow model downloads before importing caikit_nlp
os.environ['ALLOW_DOWNLOADS'] = "1"

import caikit_nlp

model_name = "google/flan-t5-small"
model = caikit_nlp.text_generation.TextGeneration.bootstrap(model_name)
model.save(f"{model_name}-caikit") # optionally save the model