-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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]: How to use multi modal large model in local env base llama_index? #9483
Comments
🤖 Hello @llf10811020205! Welcome to the LlamaIndex repository. I'm Dosu, your friendly bot assistant here to lend a hand while our human maintainers are away. I'm equipped to assist with bug resolution, answer questions, and help you find your way around the project. Just to keep things clear, I'm not a software developer or technical support rep - I'm a bot here to guide you. Ready when you are to dive into your issue! Let's get started. To utilize the multi-modal large model in a local environment using LlamaIndex, you can use the from llama_index.multi_modal_llms.openai import OpenAIMultiModal
from llama_index.llms.types import ChatMessage, MessageRole
from llama_index.schema import ImageDocument
# Initialize the OpenAIMultiModal class
multi_modal = OpenAIMultiModal(
model="gpt-4-vision-preview", # The Multi-Modal model to use from OpenAI
temperature=0.5, # The temperature to use for sampling
max_new_tokens=300, # The maximum numbers of tokens to generate
image_detail="low", # The level of details for image in API calls
api_key="your_openai_api_key", # The OpenAI API key
api_base="https://api.openai.com", # The base URL for OpenAI API
)
# Define the prompt and image documents
prompt = "Describe the image"
image_documents = [ImageDocument(url="image_url")] # Replace "image_url" with the actual URL of the image
# Use the complete method to get the model's response
response = multi_modal.complete(prompt, image_documents)
# Print the response text
print(response.text) In this example, we're using the Please replace Before you start, make sure you have the prerequisites for setting up a local environment for LlamaIndex. You need Python version 3.8.1 or higher but less than 4.0, and several Python packages. You can find the full list of prerequisites in the pyproject.toml file in the LlamaIndex repository. If you encounter any issues or need further assistance, feel free to ask. 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. |
you can use llama cpp to run some local models using llama.cpp feel free to make a pr to add llama.cpp for supporting Llava model. |
Hi, @llf10811020205, I'm helping the LlamaIndex team manage their backlog and am marking this issue as stale. From what I understand, you were seeking guidance on utilizing a multi-modal large model in a local environment based on the llama_index. Dosu-bot provided a detailed response on how to use the Could you please confirm if this issue is still relevant to the latest version of the LlamaIndex repository? If it is, please let the LlamaIndex team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days. Thank you! |
Question Validation
Question
How to use multi modal large model in local env base llama_index?
The text was updated successfully, but these errors were encountered: