mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
246710def9
One of our users noticed a bug when calling streaming models. This is because those models return an iterator. So, I've updated the Replicate `_call` code to join together the output. The other advantage of this fix is that if you requested multiple outputs you would get them all – previously I was just returning output[0]. I also adjusted the demo docs to use dolly, because we're featuring that model right now and it's always hot, so people won't have to wait for the model to boot up. The error that this fixes: ``` > llm = Replicate(model=“replicate/flan-t5-xl:eec2f71c986dfa3b7a5d842d22e1130550f015720966bec48beaae059b19ef4c”) > llm(“hello”) > Traceback (most recent call last): File "/Users/charlieholtz/workspace/dev/python/main.py", line 15, in <module> print(llm(prompt)) File "/opt/homebrew/lib/python3.10/site-packages/langchain/llms/base.py", line 246, in __call__ return self.generate([prompt], stop=stop).generations[0][0].text File "/opt/homebrew/lib/python3.10/site-packages/langchain/llms/base.py", line 140, in generate raise e File "/opt/homebrew/lib/python3.10/site-packages/langchain/llms/base.py", line 137, in generate output = self._generate(prompts, stop=stop) File "/opt/homebrew/lib/python3.10/site-packages/langchain/llms/base.py", line 324, in _generate text = self._call(prompt, stop=stop) File "/opt/homebrew/lib/python3.10/site-packages/langchain/llms/replicate.py", line 108, in _call return outputs[0] TypeError: 'generator' object is not subscriptable ``` |
||
---|---|---|
.. | ||
ai21.md | ||
aim_tracking.ipynb | ||
analyticdb.md | ||
apify.md | ||
atlas.md | ||
bananadev.md | ||
cerebriumai.md | ||
chroma.md | ||
clearml_tracking.ipynb | ||
cohere.md | ||
comet_tracking.ipynb | ||
databerry.md | ||
deepinfra.md | ||
deeplake.md | ||
forefrontai.md | ||
google_search.md | ||
google_serper.md | ||
gooseai.md | ||
gpt4all.md | ||
graphsignal.md | ||
hazy_research.md | ||
helicone.md | ||
huggingface.md | ||
jina.md | ||
llamacpp.md | ||
milvus.md | ||
modal.md | ||
myscale.md | ||
nlpcloud.md | ||
openai.md | ||
opensearch.md | ||
petals.md | ||
pgvector.md | ||
pinecone.md | ||
predictionguard.md | ||
promptlayer.md | ||
qdrant.md | ||
replicate.md | ||
runhouse.md | ||
rwkv.md | ||
searx.md | ||
serpapi.md | ||
stochasticai.md | ||
unstructured.md | ||
wandb_tracking.ipynb | ||
weaviate.md | ||
wolfram_alpha.md | ||
writer.md | ||
yeagerai.md | ||
zilliz.md |