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

feat: Add LM Studio Model and Embeddings Component #4021

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EDLLT
Copy link

@EDLLT EDLLT commented Oct 4, 2024

Fixes #3973

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Oct 4, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Oct 4, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4021.dmtpw4p5recq1.amplifyapp.com

Comment on lines +139 to +144
if output_schema_dict:
output = output.with_structured_output(schema=output_schema_dict, method="json_mode") # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm using it today (loving it, btw) and it seems it has to be json_schema. We need to update this (and the OpenAI component) to make this work better with BaseModel

Copy link
Author

Choose a reason for hiding this comment

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

I'm using it today (loving it, btw) and it seems it has to be json_schema. We need to update this (and the OpenAI component) to make this work better with BaseModel

By OpenAI component, you mean OpenAIModel.py right?

If I understand correctly, all what needs to be done is to swap method="json_mode" for method="json_schema" in both LMStudioModel.py and OpenAIModel.py

Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

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

Hey, @EDLLT

Looking good

@EDLLT
Copy link
Author

EDLLT commented Oct 4, 2024

CI error doesn't make sense to me

Error: src/backend/base/langflow/components/models/LMStudioModel.py:57:14: RUF005 Consider iterable unpacking instead of concatenation
Error: Process completed with exit code 1.

Line it's complaining about
image

Every other component I'd seen is structured like that

@EDLLT
Copy link
Author

EDLLT commented Oct 4, 2024

CI error doesn't make sense to me

Error: src/backend/base/langflow/components/models/LMStudioModel.py:57:14: RUF005 Consider iterable unpacking instead of concatenation
Error: Process completed with exit code 1.

Line it's complaining about image

Every other component I'd seen is structured like that

I guess I'll do what the dosu bot suggested
#3973 (comment)

@EDLLT EDLLT mentioned this pull request Oct 4, 2024
@ogabrielluiz
Copy link
Contributor

Hey @EDLLT

Something like this:

@EDLLT
Copy link
Author

EDLLT commented Oct 4, 2024

Hey @EDLLT

Something like this:

Hey, so I've fixed the concatenation issue(dosu bot's pretty useful id say)

All what remains is the json schema comment you had made.
When turning on the json mode and trying compile the lm studio component, it gives me the same error about json schema. I tried changing json mode and json object to json schema instead but it still gave me the same error.

I'm not completely sure what json mode is supposed to do either so maybe it's not supported by lm studio and should be removed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for LMStudio
2 participants