New model VertexAI - text-bison-32k #11572
Replies: 1 comment 1 reply
-
🤖 Olá, O problema que você está enfrentando provavelmente está relacionado ao parâmetro Mesmo que o modelo VertexAI "text-bison-32k" suporte até 8k tokens, o parâmetro Para resolver este problema, você pode ajustar o parâmetro from langchain.llms import VertexAI
vertexai = VertexAI(model_name="text-bison-32k", max_output_tokens=8000) Neste exemplo, o parâmetro Além disso, o LangChain usa o pacote Espero que isso ajude a resolver o problema. Se você tiver mais perguntas, por favor, não hesite em perguntar. Referências:
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Olá a todos, espero que estejam bem.
Estou criando um prompt utilizando o novo modelo do vertex text-bison-32k que suporta até 8k de tokens, porém estou sempre recebendo erros onde foi estourado o limite de tokens que é bem menor do que o modelo suporta.
Acredito que possa está acontecendo desse modelo ser novo e esteja incompativel com a versão atual do langchain.
Poderiam me ajudar nesse caso? Desde já muito obrigado!
Error ~>
Token indices sequence length is longer than the specified maximum sequence length for this model (4720 > 1024). Running this sequence through the model will result in indexing errors
...
ValueError: A single document was longer than the context length, we cannot handle this.
Config llm =
llm = VertexAI(
model_name="text-bison-32k",
max_output_tokens=8192,
temperature=0.2,
top_p=0.8,
top_k=40,
verbose=True,
)
script:
combine_prompt_template = PromptTemplate(template=combine_prompt, input_variables=["text"], max_tokens=8192)
text_splitter = CharacterTextSplitter.from_tiktoken_encoder(chunk_size=8192)
texts = text_splitter.split_text(txt)
docs = [Document(page_content=t) for t in texts]
chain = load_summarize_chain(llm, chain_type='map_reduce', combine_prompt=combine_prompt_template, verbose=True)
output_summary = chain.run(docs)
bullets = output_summary.strip().split('\n')
Beta Was this translation helpful? Give feedback.
All reactions