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

[langchain_community.llms.xinference]: fix error in xinference.py #29216

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

TheSongg
Copy link
Contributor

  • PR title: [langchain_community.llms.xinference]: fix error in xinference.py

  • PR message:

  • The old code raised an ValidationError: pydantic_core._pydantic_core.ValidationError: 1 validation error for Xinference when import Xinference from xinference.py. This issue has been resolved by adjusting it's type and default value.

      File "/media/vdc/python/lib/python3.10/site-packages/pydantic/main.py", line 212, in __init__
      validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
      pydantic_core._pydantic_core.ValidationError: 1 validation error for Xinference
      client
        Field required [type=missing, input_value={'server_url': 'http://10...t4', 'model_kwargs': {}}, input_type=dict]
        For further information visit https://errors.pydantic.dev/2.9/v/missing
    
  • tests:

     from langchain_community.llms import Xinference
     llm = Xinference(
       server_url="http://0.0.0.0:9997", # replace your xinference server url
      model_uid={model_uid}  # replace model_uid with the model UID return from launching the model
       )
    

Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2025 2:18am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Jan 15, 2025
@ccurme ccurme merged commit 4867fe7 into langchain-ai:master Jan 15, 2025
18 checks passed
@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community lgtm PR looks good. Use to confirm that a PR is ready for merging. size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants