ImportError: This modeling file requires the following packages that were not found in your environment: enums, better_profanity. Run `pip install enums better_profanity`

#1
by daryl149 - opened
import torch
from transformers import pipeline, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("h2oai/h2ogpt-research-oasst1-llama-65b", padding_side="left")
generate_text = pipeline(model="h2oai/h2ogpt-research-oasst1-llama-65b", tokenizer=tokenizer, torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto", prompt_type="human_bot")
res = generate_text("Why is drinking water so healthy?", max_new_tokens=100)
print(res[0]["generated_text"])

gives:
check_imports
    raise ImportError(
ImportError: This modeling file requires the following packages that were not found in your environment: enums, better_profanity. Run `pip install enums better_profanity`

I do not think the package enums is correct at all, because it's a package last updated in 2015, and does not contain the necessary PromptType class after a pip install:

    from enums import PromptType  # also supports imports from this file from other files
ImportError: cannot import name 'PromptType' from 'enums' (venv/lib/python3.10/site-packages/enums.py)
pseudotensor changed discussion status to closed

Sign up or log in to comment