Replies: 2 comments
-
🤖 Hello @anujmehta, I'm here to assist you with your query. I'm an AI bot designed to help with bug resolution, answer questions, and guide you in becoming a contributor while you wait for a human maintainer. Regarding your question about training a Language Learning Model (LLM) on a large custom library for code generation without running out of tokens when using gpt-4-32k, you can use the streaming feature provided by the LangChain framework. This feature allows you to generate tokens in a streaming manner, which can be useful when dealing with large amounts of data. Here is a sample code snippet: from langchain.llms import OpenAI
# Initialize the OpenAI model with streaming enabled
openai = OpenAI(model_name="gpt-4-32k", streaming=True)
# Define your prompt
prompt = "Your prompt here"
# Generate tokens in a streaming manner
for chunk in openai._stream(prompt):
print(chunk.text) In this code, the Please note that the As for training LLMs on custom libraries, I couldn't find a direct answer within the LangChain repository. However, the streaming feature should theoretically allow you to train an LLM on a large custom library by feeding the library to the model in chunks. I hope this helps! If you have any more questions or need further clarification, feel free to ask. Best, SourcesThis 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.
-
hello, I'm also stuck in this type of challenge, any good ideas have you found? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to train LLM with a custom library with tons of functions. Intent is to able to generate code given LLM trained on this custom library. As the library is pretty huge I run out of tokens when adding it to context of LLM (I am using gpt-4-32k).
Beta Was this translation helpful? Give feedback.
All reactions