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

Added stop sequence support to replicate #8107

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

tjaffri
Copy link
Contributor

@tjaffri tjaffri commented Jul 22, 2023

Stop sequences are useful if you are doing long-running completions and need to early-out rather than running for the full max_length... not only does this save inference cost on Replicate, it is also much faster if you are going to truncate the output later anyway.

Other LLMs support stop sequences natively (e.g. OpenAI) but I didn't see this for Replicate so adding this via their prediction cancel method.

Housekeeping: I ran make format and make lint, no issues reported in the files I touched.

I did update the replicate integration test and ran poetry run pytest tests/integration_tests/llms/test_replicate.py successfully.

Finally, I am @tjaffri https://twitter.com/tjaffri for feature announcement tweets... or if you could please tag @docugami https://twitter.com/docugami we would really appreciate that :-)

Tagging model maintainers @hwchase17 @baskaryan

Thank for all the awesome work you folks are doing.

@vercel
Copy link

vercel bot commented Jul 22, 2023

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 Jul 24, 2023 8:22pm

@dosubot dosubot bot added the 🤖:improvement Medium size change to existing code to handle new use-cases label Jul 22, 2023
@tjaffri
Copy link
Contributor Author

tjaffri commented Jul 24, 2023

Hi @baskaryan I've resolved the earlier merge conflicts and have been using this diff for the last few days with no issues... let me know if any questions.

@baskaryan
Copy link
Collaborator

this is great, thank you @tjaffri!

@baskaryan baskaryan merged commit 8f158b7 into langchain-ai:master Jul 25, 2023
@tjaffri tjaffri deleted the tjaffri/replicate_stop branch July 25, 2023 02:58
bdonkey added a commit to bdonkey/langchain that referenced this pull request Jul 26, 2023
* master: (496 commits)
  New enterprise support form (langchain-ai#8254)
  Add LLMChain example of memory with chat models (langchain-ai#8250)
  Update Broken Links (langchain-ai#8247)
  Remove operator overloading for BaseMessage (langchain-ai#8245)
  Update references (langchain-ai#8243)
  Bug Fix langchain-ai#6462 (langchain-ai#8241)
  bump 242 (langchain-ai#8238)
  Add/faiss test score threshold (langchain-ai#8224)
  use logger instead of logging (langchain-ai#8225)
  Refactored `requests` (langchain-ai#8203)
  Update Integrations links (langchain-ai#8206)
  Update base chain type hints (langchain-ai#7680)
  feat: temp fixed Could not parse LLM output on agents folder (langchain-ai#7746)
  add Hybrid retriever that not require any external service (langchain-ai#8108)
  Fixed grammar in LLM models documentation (langchain-ai#8210)
  Update supabase.py, add filter to query (matches latest supabase docs & js) (langchain-ai#7721)
  Fixed sparql SELECT and UPDATE query function (langchain-ai#7758)
  Add async support for transform chain (langchain-ai#8205)
  Added stop sequence support to replicate (langchain-ai#8107)
  Add etherscan document loader (langchain-ai#7943)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants