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

[FIX] faulty imports when using PydanticProgramMode.LM_FORMAT_ENFORCER #11355

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

nerdai
Copy link
Contributor

@nerdai nerdai commented Feb 24, 2024

Description

  • PydanticProgramMode.LM_FORMAT_ENFORCER needs integration llama-index-program-lmformatenforcer but when trying to lazy import it from core, it tries to load from ... core :)
  • Also fixed an incorrect import for llama_utils

Fixes #11351

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • I stared at the code and made sure it makes sense

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 24, 2024
try:
from llama_index.program.lmformatenforcer import (
LMFormatEnforcerPydanticProgram,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the # pants: no-infer-dep comment at the end of this import? (Similar to other 3rd party imports in core)

This helps avoid pants detecting this as a dependency when testing, making the venv smaller for core

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry just seeing this now. on it!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that did the trick - all checks have passed now :)

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 27, 2024
@logan-markewich logan-markewich merged commit 719c094 into main Feb 27, 2024
8 checks passed
@logan-markewich logan-markewich deleted the nerdai/fix-broken-import-lmformatenforcer branch February 27, 2024 03:37
Dominastorm pushed a commit to uptrain-ai/llama_index that referenced this pull request Feb 28, 2024
anoopshrma pushed a commit to anoopshrma/llama_index that referenced this pull request Mar 2, 2024
Izukimat pushed a commit to Izukimat/llama_index that referenced this pull request Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: ModuleNotFoundError: No module named 'llama_index.core.program.lmformatenforcer_program'
2 participants