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: key for versionless language models #44

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

aron
Copy link
Contributor

@aron aron commented Feb 27, 2024

This adds support for generating projects from official language models. Currently, the code generated will use a versioned model name which results in cold boots for the model.

This PR updates the code to detect the current set of official models and use the non-versioned model name. Unfortunately this list has to be hardcoded for the time being as we don't expose which models have this different interface via our API.

The example code also uses the streaming API example, again this is special cased to the language models we know support streaming because this property is also not exposed via the api.

@aron aron requested a review from zeke February 27, 2024 16:38
index.mjs Outdated
@@ -101,9 +103,21 @@ const inputs = getModelInputs(model)
console.log('Adding model data and inputs to index.js...')
const indexFile = path.join(targetDir, 'index.js')
const indexFileContents = fs.readFileSync(indexFile, 'utf8')

let run = `const output = await replicate.run(model, { input });\nconsole.log(output)`;
Copy link
Member

Choose a reason for hiding this comment

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

This makes me sad. I mean, I know it's our current reality but I feel like users should be able to run official language models with the same code they use to run other models.

@replicate/product how can we make this better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean I can simplify this and just fix the model name. But I felt that also using the streaming output made for flashier example.

Copy link
Member

@zeke zeke Feb 28, 2024

Choose a reason for hiding this comment

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

Yeah if you're cool with it can we just fix the official language model name thing here in this PR and have a separate issue/discussion about the different ways of running models?

@aron aron changed the title Fix language models fix: key for versionless language models Feb 27, 2024
@aron aron force-pushed the fix-language-models branch 2 times, most recently from 78c375c to 53baa32 Compare February 27, 2024 22:22
aron added 2 commits February 27, 2024 22:22
Currently when trying to run the script on versionless language models it's hitting a versioned api endpoint which is incredibly slow.
@aron aron force-pushed the fix-language-models branch from 53baa32 to e7d1c6d Compare February 27, 2024 22:22
@zeke
Copy link
Member

zeke commented Feb 28, 2024

@aron the integration test for Node 18 is hanging: https://github.com/replicate/create-replicate/actions/runs/8072156594/job/22053328642?pr=44 -- looks like the test is successful but the process is not exiting.

Same thing on #45

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.

2 participants