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

Error running example.py #6

Closed
eqian99 opened this issue Jul 8, 2023 · 1 comment
Closed

Error running example.py #6

eqian99 opened this issue Jul 8, 2023 · 1 comment
Assignees

Comments

@eqian99
Copy link

eqian99 commented Jul 8, 2023

🐛 Describe the bug

Ran into this error when running example.py

ERROR:root:Authentication error. Skipping request.
ERROR:root:Authentication error. Skipping request.
WARNING:root:Can't find similar_to_expected in scores. Did you run `evaluate`?
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/qianh1/Code/prompttools/examples/prompttests/example.py", line 43, in <module>
    prompttest.main()
  File "/Users/qianh1/Code/prompttools/prompttools/testing/prompttest.py", line 108, in main
    failures = sum([test() for test in TESTS_TO_RUN])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/qianh1/Code/prompttools/prompttools/testing/prompttest.py", line 108, in <listcomp>
    failures = sum([test() for test in TESTS_TO_RUN])
                    ^^^^^^
  File "/Users/qianh1/Code/prompttools/prompttools/testing/prompttest.py", line 58, in runs_test
    return run_prompt_template_test(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/qianh1/Code/prompttools/prompttools/testing/runner/prompt_template_runner.py", line 82, in run_prompt_template_test
    scored_template[prompt_template] < threshold
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
@steventkrawczyk steventkrawczyk self-assigned this Jul 8, 2023
@steventkrawczyk
Copy link
Contributor

steventkrawczyk commented Jul 8, 2023

It looks like you're trying to run the example without setting your OPENAI_API_KEY, or setting DEBUG=1. Try running the following:

DEBUG=1 python example.py

I'll make the instructions and error handling more explicit.

@eqian99 eqian99 closed this as completed Jul 8, 2023
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

2 participants