Open factory-droid[bot] opened 2 weeks ago
[!IMPORTANT]
Solutions for GitHub Action Failures - e72b6058445dcaf94e9befd2b3ef6c5169d949df - 1
To fix the error, update the config.yaml
file to include the example_model_input
field in the model_metadata
section. Here is an example of how to update the file:
description: Deploy Florence-2 Large model for multi-task computer vision
model_metadata:
model_name: Florence-2-Large
avatar_url: https://huggingface.co/microsoft/Florence-2-large/resolve/main/florence2_avatar.png
cover_image_url: https://huggingface.co/microsoft/Florence-2-large/resolve/main/florence2_cover_image.png
tags:
- vision
- multi-task
example_model_input:
prompt: "<OD>"
image_url: "https://example.com/test_image.jpg"
python_version: py39
requirements:
- transformers==4.30.0
- torch==2.0.1
- torchvision==0.15.2
- GitPython==3.1.31
resources:
accelerator: A100
cpu: 4
memory: 16G
use_gpu: true
secrets:
hf_access_token:
description: Access token for Hugging Face
spec_version: 1
[!IMPORTANT]
Solutions for GitHub Action Failures - c8717eb8a3c225035c23649ac2f5573c0d958f66 - 2
The error in the GitHub Actions workflow is due to a ValidationError
indicating that a value expected to be a string was instead an integer. To fix this error, ensure that the model_id
and deployment_id
values returned from the truss_push
function are strings. You can modify the truss_push
function as follows:
def truss_push():
print("Pushing model...")
with open("/home/runner/.trussrc", "w") as config_file:
config_file.write(
f"""[baseten]
remote_provider = baseten
api_key = {API_KEY}
remote_url = https://app.staging.baseten.co"""
)
result = subprocess.run(["truss", "push", "--trusted"], capture_output=True)
match = re.search(
r"View logs for your deployment at \n?https://app\.staging\.baseten\.co/models/(\w+)/logs/(\w+)",
result.stdout.decode(),
)
if not match:
raise Exception(
f"Failed to push model:\n\nSTDOUT: {result.stdout.decode()}\nSTDERR: {result.stderr.decode()}"
)
model_id = str(match.group(1)) # Ensure model_id is a string
deployment_id = str(match.group(2)) # Ensure deployment_id is a string
print(
f"Model pushed successfully. model-id: {model_id}. deployment-id: {deployment_id}"
)
return model_id, deployment_id
[!IMPORTANT]
Solutions for GitHub Action Failures - 01cde3d0423e92444ad16b2e9410e3c46cff2ed6 - 3
The error in the GitHub Actions workflow is due to a ValidationError
indicating that a value expected to be a string was instead an integer. To fix this error, ensure that model_id
and deployment_id
are explicitly converted to strings in the bin/test_truss_deploy.py
script.
To fix the error, update the bin/test_truss_deploy.py
script as follows:
model_id = str(match.group(1)) # Ensure model_id is a string
deployment_id = str(match.group(2)) # Ensure deployment_id is a string
[!IMPORTANT]
Solutions for GitHub Action Failures - cc717c457738ee89134b2f6eb4292b72204d3b3a - 4
To fix the ValidationError
in the test_truss_deploy.py
script, ensure that the model_id
and deployment_id
values are converted to strings. You can do this by updating the truss_push
function as follows:
model_id = str(match.group(1)) # Ensure model_id is a string
deployment_id = str(match.group(2)) # Ensure deployment_id is a string
Summary of Changes
This pull request integrates the Florence-2-Large model into the repository. The changes include:
These changes implement the plan to deploy and validate the Florence-2-Large model, ensuring it is ready for multi-task computer vision tasks.
Fixes BT-11229
Tips