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

[BUG] prompty-quickstart.ipynb run evaluation not working due to RuntimeError #3291

Closed
imk4novazoon opened this issue May 16, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@imk4novazoon
Copy link

imk4novazoon commented May 16, 2024

Describe the bug
Run evaluation with PFClient throws RuntimeError

How To Reproduce the bug
Steps to reproduce the behavior, how frequent can you experience the bug:

  1. follow the exact instructions in prompty-quickstart.ipynb up to pf = PFClient()
  2. Run the following code:
flow = "./basic.prompty"  # path to the prompty file
data = "./data.jsonl"  # path to the data file

# create run with the flow and data
base_run = pf.run(
    flow=flow,
    data=data,
    column_mapping={
        "first_name": "${data.first_name}",
        "last_name": "${data.last_name}",
        "question": "${data.question}",
    },
    stream=True,
)

Happens consistently.

Expected behavior

execute pf.run()

Screenshots
Screenshot 2024-05-16 103609

Running Information(please complete the following information):

  • Promptflow Package Version using pf -v: 1.10.1
  • Operating System: Windows 11
  • Python Version using python --version: python== 3.9.13
@imk4novazoon imk4novazoon added the bug Something isn't working label May 16, 2024
@lalala123123
Copy link
Contributor

Hi @imk4novazoon , does this issue occur when executing the notebook or a python script?
I did not reproduce this issue when executing it in notebook.
If you execute this code in a python script, which is by design, you need to move pf.run to name=="main"

@imk4novazoon
Copy link
Author

Thank you @lalala123123 . That was it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants