Skip to content
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

Inputting embeddings directly #205

Open
liechtym opened this issue Feb 24, 2024 · 0 comments
Open

Inputting embeddings directly #205

liechtym opened this issue Feb 24, 2024 · 0 comments

Comments

@liechtym
Copy link

I have a use case where I need to modify input embeddings before they

from ctransformers import AutoModelForCausalLM

llm = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7b-Chat-GGUF", model_file="llama-2-7b-chat.Q4_K_M.gguf", model_type="llama", gpu_layers=50)

embeddings = llm.embed('Some text')

# Code to modify embeddings
modified_embeddings = some_function(embeddings)

res = llm.generate(inputs_embeds=modified_embeddings)

Is there any way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant