Skip to content

Conversation

@pmeier
Copy link
Contributor

@pmeier pmeier commented Jul 7, 2023

As of today (July 7, 2023), the MosaicML API uses "inputs" for the prompt

image

but we have

https://github.com/hwchase17/langchain/blob/0ed2da70200ada39f5319f604b4c5248bc98e81b/langchain/llms/mosaicml.py#L125

Furthermore, the output should be inside the "outputs" key

image

but we have

https://github.com/hwchase17/langchain/blob/0ed2da70200ada39f5319f604b4c5248bc98e81b/langchain/llms/mosaicml.py#L163-L170

This PR adds support for this new format.

<rant>
It is beyond me, why they apparently have versioned their API (endpoints look like https://models.hosted-on.mosaicml.hosting/mpt-7b-instruct/v1/predict; note the v1 in there), but just keep changing the API without upping the version number. There is a good reason for
https://github.com/hwchase17/langchain/blob/0ed2da70200ada39f5319f604b4c5248bc98e81b/langchain/llms/mosaicml.py#L160-L161
</rant>

CC @hwchase17, @baskaryan

@vercel
Copy link

vercel bot commented Jul 7, 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) Jul 7, 2023 6:05pm

@baskaryan
Copy link
Collaborator

makes sense to me, cc would be great if you could double check @dakinggg

@baskaryan baskaryan added the lgtm label Jul 7, 2023
Copy link
Contributor

@margaretqian margaretqian left a comment

Choose a reason for hiding this comment

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

Thank you for making this change! Apologies for the API changes, the version in the docs will be stable moving forward. We currently have backwards compatibility wrt the changes here, but were also in the process of making the update to the new API, so thanks for helping out here! We'll will propagate the same change to the embedding models shortly as well.

@baskaryan
Copy link
Collaborator

thanks @pmeier!

@baskaryan baskaryan merged commit da5b072 into langchain-ai:master Jul 7, 2023
baskaryan added a commit that referenced this pull request Aug 25, 2023
As noted in prior PRs (#6060,
#7348), the input/output
format has changed a few times as we've stabilized our inference API.
This PR updates the API to the latest stable version as indicated in our
docs: https://docs.mosaicml.com/en/latest/inference.html

The input format looks like this:

`{"inputs": [<prompt>]}
`

The output format looks like this:
`
{"outputs": [<output_text>]}
`
---------

Co-authored-by: Bagatur <[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.

3 participants