-
Notifications
You must be signed in to change notification settings - Fork 11
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
Not consistent results for same input with ChatWatsonx, meta-llama/llama-3-1-70b-instruct, DECODING_METHOD='greedy' #43
Comments
Hi @polubarev I retested you code using params = {
"temperature": 0
} Could you please retest your issue with set params as above ? |
Hi @MateuszOssGit from langchain_core.messages import HumanMessage, SystemMessage
from langchain_ibm import ChatWatsonx
import pandas as pd
from tqdm import tqdm
api_key = 'api_key'
project_id = 'project_id'
credentials = {
"url": "https://us-south.ml.cloud.ibm.com",
"apikey": api_key}
parameters = {
'temperature': 0,
'max_tokens': 200,
}
ibm_llm = ChatWatsonx(
model_id="meta-llama/llama-3-1-70b-instruct",
url=credentials.get("url"),
apikey=credentials.get("apikey"),
project_id=project_id,
params=parameters,
)
system_message = SystemMessage(
content="You are a helpful assistant which telling short-info about provided topic."
)
human_message = HumanMessage(content="horse")
test_res = [ibm_llm.invoke([system_message, human_message]) for _ in tqdm(range(20))]
n_unique_outputs = pd.Series([message.content for message in test_res]).nunique()
print(f"Number of unique outputs: {n_unique_outputs}") Result is: Sometimes to get this results you need to run more iterations. |
I conducted a test with 50 iterations and observed six unique outputs. I plan to raise an issue in the Did you observed it only with |
I have not tested other models. I think they would have the same issues. |
Yes, you are right. I created issue and i will inform you about updates. |
Found out that IBM ChatWatsonx integration with Langchain and IBM watsonx.ai Text Chat API provide not consistent outputs for the same input with
decoding_method=greedy
ortemperature=0
.langchain-ibm == 0.3.3
langchain-core == 0.3.19
ibm_watsonx_ai == 1.1.23
IBM ChatWatsonx integration with Langchain
IBM watsonx.ai Text Chat API
This issue affects projects including agentic behavior in solutions.
The text was updated successfully, but these errors were encountered: