Skip to content

Reproduce the results #27

@ck-amrahd

Description

@ck-amrahd

Hi guys,
I am trying to reproduce the results from the paper. While going through the walkthrough code, I get the following error:

Traceback (most recent call last):
  File "/home/orion/PycharmProjects/causality/pywhyllm/walkthrough.py", line 15, in <module>
    result = modeler.suggest_pairwise_relationship("ice cream sales", "shark attacks")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orion/PycharmProjects/causality/pywhyllm/pywhyllm/simple_model_suggester.py", line 62, in suggest_pairwise_relationship
    program = guidance(prompt)
              ^^^^^^^^^^^^^^^^
  File "/home/orion/PycharmProjects/causality/.venv/lib/python3.12/site-packages/guidance/__init__.py", line 30, in __call__
    return _decorator(f, stateless=stateless, cache=cache, dedent=dedent, model=model)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orion/PycharmProjects/causality/.venv/lib/python3.12/site-packages/guidance/__init__.py", line 57, in _decorator
    f = strip_multiline_string_indents(f)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/orion/PycharmProjects/causality/.venv/lib/python3.12/site-packages/guidance/_utils.py", line 150, in strip_multiline_string_indents
    temp = inspect.getsource(f)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/inspect.py", line 1278, in getsource
    lines, lnum = getsourcelines(object)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/inspect.py", line 1260, in getsourcelines
    lines, lnum = findsource(object)
                  ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/inspect.py", line 1071, in findsource
    file = getsourcefile(object)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/inspect.py", line 948, in getsourcefile
    filename = getfile(object)
               ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/inspect.py", line 928, in getfile
    raise TypeError('module, class, method, function, traceback, frame, or '
TypeError: module, class, method, function, traceback, frame, or code object was expected, got str

The error comes from parsing the above two variables, do you have any suggestions on why this might be the case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions