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

[Question]: trust_remote_code=True #10373

Open
1 task done
Bearsaerker opened this issue Jan 31, 2024 · 3 comments
Open
1 task done

[Question]: trust_remote_code=True #10373

Bearsaerker opened this issue Jan 31, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Bearsaerker
Copy link

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

I'm trying to get the onnx of jina running. It tells me, that I have to pass the argument "trust_remote_code=True", but I can't as it is described in the example of the Llama Index Embeddings Guide Doc.

from llama_index.embeddings import OptimumEmbedding

OptimumEmbedding.create_and_save_optimum_model(
     "jinaai/jina-embeddings-v2-base-de", "./JinaONNX"
)

It may be that I'm too stupid to find the right place to insert it, but help would be very appreciated!

@Bearsaerker Bearsaerker added the question Further information is requested label Jan 31, 2024
Copy link

dosubot bot commented Jan 31, 2024

🤖

Hey @Bearsaerker! Great to see you back with another intriguing question. Hope you've been doing well!

Based on the context provided, it seems like you're trying to initialize the OptimumEmbedding model with the trust_remote_code=True argument. However, in the example you've provided, the OptimumEmbedding model is being initialized without any arguments.

The trust_remote_code=True argument is typically used when initializing the HuggingFaceEmbedding model, as shown in the code snippet from the jina_embeddings.ipynb example:

# download model locally
# note: you need enough RAM+compute to run this
embed_model = HuggingFaceEmbedding(
    model_name=model_name, trust_remote_code=True
)

In this code, the HuggingFaceEmbedding model is being initialized with the model_name variable and the trust_remote_code argument is set to True. This means that the model will trust and execute remote code when necessary.

If you're trying to use the trust_remote_code=True argument with the OptimumEmbedding model, it's possible that this argument is not supported. I recommend checking the documentation or the source code of the OptimumEmbedding model to see if this argument is supported.

If you're still having trouble, could you please provide more information about the error message you're receiving and the exact code you're trying to run? This will help me better understand the issue and provide a more accurate solution.

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.

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label May 1, 2024
@shaoyu-lu
Copy link

shaoyu-lu commented May 8, 2024

OptimumEmbedding.create_and_save_optimum_model(
     "jinaai/jina-embeddings-v2-base-de", 
     "./JinaONNX", 
     export_kwargs={'trust_remote_code': True}
     )

Give this a try. I successfully passed trust_remote_code by using export_kwargs.

@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label May 8, 2024
Copy link

dosubot bot commented May 8, 2024

@logan-markewich Could you please assist @shaoyu-lu with the issue of passing parameters using export_kwargs when initializing the OptimumEmbedding model? They have provided an example where they successfully passed the parameters. Thank you!

Details

About Dosu
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.

To continue the conversation, mention @dosu.

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

No branches or pull requests

2 participants