what image tag to use for Phi3 Vision 128K Instruct inference?
- User
what image tag to use for Phi3 Vision 128K Instruct inference?
- Assistant
To perform inference using the Phi3 Vision 128K Instruct model, you can use the Docker image
mosaicml/p3:vision-2.0-2023.09-21072. Here's a brief overview of how you might run a Docker container for inference with this image.Pulling the Docker Image
First, you need to pull the Docker image from the MosaicML repository:
docker pull mosaicml/p3:vision-2.0-2023.09-21072Running the Docker Container
Once the image is pulled, you can run a container based on it. Here's an example of how to do so:
docker run -it mosaicml/p3:vision-2.0-2023.09-21072You'll often want to mount directories or pass additional parameters depending on your specific use-case, such as where your model weights and input data are stored.
- User
I have this code: model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-vision-128k-instruct", trust_remote_code=True) processor = AutoProcessor.from_pretrained("microsoft/Phi-3-vision-128k-instruct", trust_remote_code=True)
image = ImageOps.grayscale(Image.open('./Test data/Notes/images/Bo girat _page_001.jpg')) query = 'Is there any handwritten text on the image? Answer with either "YES" or "NO".'
text = f"User: Answer briefly.{query}\nAssistant: " inputs = processor(text=text, images=[image], return_tensors="pt", padding=True)
It gives the following error: AssertionError: total images must be the same as the number of image tags, got 0 image tags and 1 images
How to solve it?
- Assistant
The error you're encountering indicates that the number of image tags (i.e.,
<img>) in your text does not match the number of images you're providing. In your text, there appears to be an issue with how the image tag is included within the string.Here's a corrected version of the code, ensuring that the image tag is correctly placed and counted:
Corrected Code:
from PIL import Image, ImageOps from transformers import AutoModelForCausalLM, AutoProcessor # Initialize model and processor model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-vision-128k-instruct", trust_remote_code=True) processor = AutoProcessor.from_pretrained("microsoft/Phi-3-vision-128k-instruct", trust_remote_code=True) # Load and preprocess the image image = ImageOps.grayscale(Image.open('./Test data/Notes/images/Bo girat _page_001.jpg')) # Define the query query = 'Is there any handwritten text on the image? Answer with either "YES" or "NO".' # Construct input text # Include the <img> tag in the correct place within the text to match the number of images provided text = f"User: Answer briefly.<img>{query}\nAssistant: " # Ensure the text contains one <img> tag for one image inputs = processor(text=text, images=[image], return_tensors="pt", padding=True) # Check the processed inputs print(inputs) - User
what does " RBROL01416 temporarily deployed to dev 5 days ago — with GitHub Actions (Inactive)" mean?
- Assistant
The phrase "RBROL01416 temporarily deployed to dev 5 days ago — with GitHub Actions (Inactive)" likely represents a status or log message related to a software deployment process. Here's a breakdown of what each part might mean:
-
RBROL01416: This could be a unique identifier, such as a release or build number, a ticket ID, a branch name, or a code revision. It helps to identify the specific deployment or set of changes.
-
temporarily deployed: This indicates the action taken, which is the deployment of this specific identifier (RBROL01416) to a development environment. "Temporarily deployed" suggests that this deployment is not permanent and may be rolled back or replaced in the near future.
-
- User
what does " RBROL01416 temporarily deployed to dev 5 days ago — with GitHub Actions (Inactive)" mean? RBROL01416 is a github user.
- Assistant
Given that RBROL01416 is a GitHub user, the phrase "RBROL01416 temporarily deployed to dev 5 days ago — with GitHub Actions (Inactive)" likely refers to an action or workflow related to that user's activities on a GitHub repository. Here's a breakdown considering this new context:
-
RBROL01416: Refers to the GitHub user who performed the action.
-
- User
What does "RBROL01416 had a problem deploying to dev 2 days ago — with GitHub Actions Failure" mean? RBROL01416 is a github user.
- Assistant
Given that RBROL01416 is a GitHub user, the phrase "RBROL01416 had a problem deploying to dev 2 days ago — with GitHub Actions Failure" indicates that this specific user encountered an issue while trying to deploy something to a development environment using GitHub Actions. Here's a detailed breakdown of each part:
- User
This is a github log: "RBROL01416 merged commit 123420b into master yesterday (3 checks passed)". what are those 3 checks? are there any unit tests when merging branches?
- Assistant