Skip to content

Conversation

@samhita-alla
Copy link
Contributor

@samhita-alla samhita-alla commented Jun 14, 2023

This PR adds a Flyte callback handler that can be triggered from within a Flyte task to track LangChain experiments.

image

Before submitting

Who can review?

Tag maintainers/contributors who might be interested:

Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
@vowelparrot
Copy link
Contributor

Good start! had some requests

@samhita-alla
Copy link
Contributor Author

Hi @vowelparrot! Thanks for reviewing the PR. I'm currently testing this PR and it isn't complete yet. I'll make sure to incorporate your suggestions.

Signed-off-by: Samhita Alla <[email protected]>
@vercel
Copy link

vercel bot commented Jun 19, 2023

@samhita-alla is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
Signed-off-by: Samhita Alla <[email protected]>
@samhita-alla samhita-alla marked this pull request as ready for review June 20, 2023 09:16
Copy link

@zeryx zeryx left a comment

Choose a reason for hiding this comment

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

pandas and spacy are optional langchain imports, added some comments

Comment on lines 92 to 93
self.pandas = import_pandas()
spacy = import_spacy()
Copy link

Choose a reason for hiding this comment

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

Minor consideration, both spacy and pandas are optional imports (as per the poet pyproject.toml.

This may fail as both pandas and spacy are not imported by flyte

https://github.com/hwchase17/langchain/blob/master/pyproject.toml#L88
https://github.com/hwchase17/langchain/blob/master/pyproject.toml#L29

Copy link
Contributor

Choose a reason for hiding this comment

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

What are you suggesting here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeryx, please let me know your suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's up to you @samhita-alla but if you still want SOME logging even if users don't want to install pandas and spacy, you could log a warning and then reduce the number of facets logged

Copy link
Contributor Author

@samhita-alla samhita-alla Jun 29, 2023

Choose a reason for hiding this comment

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

@vowelparrot, the callback will now log a warning if spacy is not installed. As for pandas, it is automatically installed with flytekit, so there shouldn't be any issues in that regard.

Let me know if you have any further feedback. The PR can be merged if no further changes are required.

@vercel
Copy link

vercel bot commented Jun 21, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jun 29, 2023 8:42am

Signed-off-by: Samhita Alla <[email protected]>
@samhita-alla
Copy link
Contributor Author

@vowelparrot, could you please review the PR again?

@hinthornw hinthornw changed the base branch from master to wfh/flyte-callbcak June 30, 2023 16:53
@hinthornw hinthornw merged commit f3068ed into langchain-ai:wfh/flyte-callbcak Jun 30, 2023
hinthornw added a commit that referenced this pull request Jun 30, 2023
Signed-off-by: Samhita Alla <[email protected]>
Co-authored-by: Samhita Alla <[email protected]>
vowelparrot pushed a commit that referenced this pull request Jul 4, 2023
Signed-off-by: Samhita Alla <[email protected]>
Co-authored-by: Samhita Alla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants