Closed adarshxs closed 11 months ago
Answer generated by a π€
From your description, it appears that you're encountering an error message stating "generate() got multiple keyword arguments for 'stop_sequences'" when running your script with Streamlit. This error typically suggests that the 'stop_sequences' argument is being passed more than once to the 'generate' function.
Looking at the traceback, the error seems to originate from the 'generate' function in the 'HuggingFaceTextGenInference' class within the 'langchain/llms/huggingface_text_gen_inference.py' file. The 'stop_sequences' argument is passed to the 'generate' function via the 'invocation_params' dictionary in the '_call' method. If 'stop_sequences' is also included in the '**kwargs' when calling the 'generate' function, it would be passed twice, leading to the error you're seeing.
To resolve this issue, you should ensure that 'stop_sequences' is not included in the '**kwargs' when calling the 'generate' function. If it is, you'll need to remove it before calling 'generate'.
Please review your code to ensure 'stop_sequences' is not being passed twice to the 'generate' function. If you're using the 'TextGen' class or the 'generate_prompt' and '_generate_with_cache' methods in your code, make sure that 'stop_sequences' is not being passed as an argument to both 'HuggingFaceTextGenInference' and these classes or methods, as this could also cause the error.
This is one potential solution based on the information provided. If this doesn't resolve your issue, or if your experience contradicts this solution, it might be helpful to ensure you're using the latest version of the LangChain framework.
If you believe this is a bug that could impact other users and you're comfortable doing so, you're encouraged to make a pull request with the necessary changes. Your contribution would be greatly appreciated by the LangChain community.
This response is meant to be useful, save you time, and share context. 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.
Was solved in #8044
System Info
I'm not sure what exactly is causing the issue. Is it langchain, TGI, or streamlit
generate() got multiple keyword arguments for 'stop_sequences' upon running the script along with streamlit
the above script works properly but while using it with chainlit I run into the
generate() got multiple keyword arguments for 'stop_sequences'
Who can help?
@hwchase17 @baskaryan
Information
Related Components
Reproduction
the above script works properly but while using it with chainlit I run into the
generate() got multiple keyword arguments for 'stop_sequences'
Expected behavior
generate normally