Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

name 'openai' is not defined #9

Open
clclclaiggg opened this issue Nov 29, 2023 · 2 comments
Open

name 'openai' is not defined #9

clclclaiggg opened this issue Nov 29, 2023 · 2 comments

Comments

@clclclaiggg
Copy link

Hello, I am using the code:
import numpy as np
from imodelsx import explain_module_sasc

a toy module that responds to the length of a string

mod = lambda str_list: np.array([len(s) for s in str_list])

a toy dataset where the longest strings are animals

text_str_list = ["red", "blue", "x", "1", "2", "hippopotamus", "elephant", "rhinoceros"]
explanation_dict = explain_module_sasc(
text_str_list,
mod,
ngrams=1,
)
print(explanation_dict)
Errors will be encountered:
name 'openai' is not defined
How to solve this problem. thank you.

@Cupid777
Copy link

Cupid777 commented Jan 5, 2024

i also meet this question. Is there any good solution?

@csinva
Copy link
Member

csinva commented Jan 5, 2024

Hello, the openai package needs to be installed with pip install openai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants