481 lines
21 KiB
JSON
481 lines
21 KiB
JSON
{
|
|
"url": "https://replicate.com/andreasjansson/blip-2",
|
|
"owner": "andreasjansson",
|
|
"name": "blip-2",
|
|
"description": "Answers questions about images",
|
|
"visibility": "public",
|
|
"github_url": "https://github.com/daanelson/cog-blip-2",
|
|
"paper_url": "https://arxiv.org/abs/2301.12597",
|
|
"license_url": null,
|
|
"run_count": 0,
|
|
"cover_image_url": "https://tjzk.replicate.delivery/models_models_featured_image/031b9aee-ed15-4429-a7e4-813b72e9edc5/gg_bridge.jpeg",
|
|
"default_example": {
|
|
"id": "uhd4lhedtvdlbnm2cyhzx65zpe",
|
|
"model": "andreasjansson/blip-2",
|
|
"version": "4b32258c42e9efd4288bb9910bc532a69727f9acd26aa08e175713a0a857a608",
|
|
"status": "succeeded",
|
|
"input": {
|
|
"image": "https://replicate.delivery/pbxt/IJEPmgAlL2zNBNDoRRKFegTEcxnlRhoQxlNjPHSZEy0pSIKn/gg_bridge.jpeg",
|
|
"caption": false,
|
|
"question": "what body of water does this bridge cross?",
|
|
"temperature": 1
|
|
},
|
|
"output": "san francisco bay",
|
|
"logs": "input for question answering: Question: what body of water does this bridge cross? Answer:",
|
|
"error": null,
|
|
"metrics": {
|
|
"predict_time": 0.949567,
|
|
"total_time": 1.010552
|
|
},
|
|
"created_at": "2023-02-13T22:26:48.385476Z",
|
|
"started_at": "2023-02-13T22:26:48.446461Z",
|
|
"completed_at": "2023-02-13T22:26:49.396028Z",
|
|
"urls": {
|
|
"get": "https://api.replicate.com/v1/predictions/uhd4lhedtvdlbnm2cyhzx65zpe",
|
|
"cancel": "https://api.replicate.com/v1/predictions/uhd4lhedtvdlbnm2cyhzx65zpe/cancel"
|
|
}
|
|
},
|
|
"latest_version": {
|
|
"id": "f677695e5e89f8b236e52ecd1d3f01beb44c34606419bcc19345e046d8f786f9",
|
|
"created_at": "2023-11-20T20:18:16.669421+00:00",
|
|
"cog_version": "0.8.3",
|
|
"openapi_schema": {
|
|
"info": {
|
|
"title": "Cog",
|
|
"version": "0.1.0"
|
|
},
|
|
"paths": {
|
|
"/": {
|
|
"get": {
|
|
"summary": "Root",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"title": "Response Root Get"
|
|
}
|
|
}
|
|
},
|
|
"description": "Successful Response"
|
|
}
|
|
},
|
|
"operationId": "root__get"
|
|
}
|
|
},
|
|
"/shutdown": {
|
|
"post": {
|
|
"summary": "Start Shutdown",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"title": "Response Start Shutdown Shutdown Post"
|
|
}
|
|
}
|
|
},
|
|
"description": "Successful Response"
|
|
}
|
|
},
|
|
"operationId": "start_shutdown_shutdown_post"
|
|
}
|
|
},
|
|
"/predictions": {
|
|
"post": {
|
|
"summary": "Predict",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PredictionResponse"
|
|
}
|
|
}
|
|
},
|
|
"description": "Successful Response"
|
|
},
|
|
"422": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
},
|
|
"description": "Validation Error"
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"in": "header",
|
|
"name": "prefer",
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Prefer"
|
|
},
|
|
"required": false
|
|
}
|
|
],
|
|
"description": "Run a single prediction on the model",
|
|
"operationId": "predict_predictions_post",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PredictionRequest"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/health-check": {
|
|
"get": {
|
|
"summary": "Healthcheck",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"title": "Response Healthcheck Health Check Get"
|
|
}
|
|
}
|
|
},
|
|
"description": "Successful Response"
|
|
}
|
|
},
|
|
"operationId": "healthcheck_health_check_get"
|
|
}
|
|
},
|
|
"/predictions/{prediction_id}": {
|
|
"put": {
|
|
"summary": "Predict Idempotent",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/PredictionResponse"
|
|
}
|
|
}
|
|
},
|
|
"description": "Successful Response"
|
|
},
|
|
"422": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
},
|
|
"description": "Validation Error"
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "prediction_id",
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Prediction ID"
|
|
},
|
|
"required": true
|
|
},
|
|
{
|
|
"in": "header",
|
|
"name": "prefer",
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Prefer"
|
|
},
|
|
"required": false
|
|
}
|
|
],
|
|
"description": "Run a single prediction on the model (idempotent creation).",
|
|
"operationId": "predict_idempotent_predictions__prediction_id__put",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/PredictionRequest"
|
|
}
|
|
],
|
|
"title": "Prediction Request"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
}
|
|
}
|
|
},
|
|
"/predictions/{prediction_id}/cancel": {
|
|
"post": {
|
|
"summary": "Cancel",
|
|
"responses": {
|
|
"200": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"title": "Response Cancel Predictions Prediction Id Cancel Post"
|
|
}
|
|
}
|
|
},
|
|
"description": "Successful Response"
|
|
},
|
|
"422": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HTTPValidationError"
|
|
}
|
|
}
|
|
},
|
|
"description": "Validation Error"
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "prediction_id",
|
|
"schema": {
|
|
"type": "string",
|
|
"title": "Prediction ID"
|
|
},
|
|
"required": true
|
|
}
|
|
],
|
|
"description": "Cancel a running prediction",
|
|
"operationId": "cancel_predictions__prediction_id__cancel_post"
|
|
}
|
|
}
|
|
},
|
|
"openapi": "3.0.2",
|
|
"components": {
|
|
"schemas": {
|
|
"Input": {
|
|
"type": "object",
|
|
"title": "Input",
|
|
"required": [
|
|
"image"
|
|
],
|
|
"properties": {
|
|
"image": {
|
|
"type": "string",
|
|
"title": "Image",
|
|
"format": "uri",
|
|
"x-order": 0,
|
|
"description": "Input image to query or caption"
|
|
},
|
|
"caption": {
|
|
"type": "boolean",
|
|
"title": "Caption",
|
|
"default": false,
|
|
"x-order": 1,
|
|
"description": "Select if you want to generate image captions instead of asking questions"
|
|
},
|
|
"context": {
|
|
"type": "string",
|
|
"title": "Context",
|
|
"x-order": 3,
|
|
"description": "Optional - previous questions and answers to be used as context for answering current question"
|
|
},
|
|
"question": {
|
|
"type": "string",
|
|
"title": "Question",
|
|
"default": "What is this a picture of?",
|
|
"x-order": 2,
|
|
"description": "Question to ask about this image. Leave blank for captioning"
|
|
},
|
|
"temperature": {
|
|
"type": "number",
|
|
"title": "Temperature",
|
|
"default": 1,
|
|
"maximum": 1,
|
|
"minimum": 0.5,
|
|
"x-order": 5,
|
|
"description": "Temperature for use with nucleus sampling"
|
|
},
|
|
"use_nucleus_sampling": {
|
|
"type": "boolean",
|
|
"title": "Use Nucleus Sampling",
|
|
"default": false,
|
|
"x-order": 4,
|
|
"description": "Toggles the model using nucleus sampling to generate responses"
|
|
}
|
|
}
|
|
},
|
|
"Output": {
|
|
"type": "string",
|
|
"title": "Output"
|
|
},
|
|
"Status": {
|
|
"enum": [
|
|
"starting",
|
|
"processing",
|
|
"succeeded",
|
|
"canceled",
|
|
"failed"
|
|
],
|
|
"type": "string",
|
|
"title": "Status",
|
|
"description": "An enumeration."
|
|
},
|
|
"WebhookEvent": {
|
|
"enum": [
|
|
"start",
|
|
"output",
|
|
"logs",
|
|
"completed"
|
|
],
|
|
"type": "string",
|
|
"title": "WebhookEvent",
|
|
"description": "An enumeration."
|
|
},
|
|
"ValidationError": {
|
|
"type": "object",
|
|
"title": "ValidationError",
|
|
"required": [
|
|
"loc",
|
|
"msg",
|
|
"type"
|
|
],
|
|
"properties": {
|
|
"loc": {
|
|
"type": "array",
|
|
"items": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "integer"
|
|
}
|
|
]
|
|
},
|
|
"title": "Location"
|
|
},
|
|
"msg": {
|
|
"type": "string",
|
|
"title": "Message"
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"title": "Error Type"
|
|
}
|
|
}
|
|
},
|
|
"PredictionRequest": {
|
|
"type": "object",
|
|
"title": "PredictionRequest",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"title": "Id"
|
|
},
|
|
"input": {
|
|
"$ref": "#/components/schemas/Input"
|
|
},
|
|
"webhook": {
|
|
"type": "string",
|
|
"title": "Webhook",
|
|
"format": "uri",
|
|
"maxLength": 65536,
|
|
"minLength": 1
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"title": "Created At",
|
|
"format": "date-time"
|
|
},
|
|
"output_file_prefix": {
|
|
"type": "string",
|
|
"title": "Output File Prefix"
|
|
},
|
|
"webhook_events_filter": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/WebhookEvent"
|
|
},
|
|
"default": [
|
|
"start",
|
|
"logs",
|
|
"completed",
|
|
"output"
|
|
],
|
|
"uniqueItems": true
|
|
}
|
|
}
|
|
},
|
|
"PredictionResponse": {
|
|
"type": "object",
|
|
"title": "PredictionResponse",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"title": "Id"
|
|
},
|
|
"logs": {
|
|
"type": "string",
|
|
"title": "Logs",
|
|
"default": ""
|
|
},
|
|
"error": {
|
|
"type": "string",
|
|
"title": "Error"
|
|
},
|
|
"input": {
|
|
"$ref": "#/components/schemas/Input"
|
|
},
|
|
"output": {
|
|
"$ref": "#/components/schemas/Output"
|
|
},
|
|
"status": {
|
|
"$ref": "#/components/schemas/Status"
|
|
},
|
|
"metrics": {
|
|
"type": "object",
|
|
"title": "Metrics"
|
|
},
|
|
"version": {
|
|
"type": "string",
|
|
"title": "Version"
|
|
},
|
|
"created_at": {
|
|
"type": "string",
|
|
"title": "Created At",
|
|
"format": "date-time"
|
|
},
|
|
"started_at": {
|
|
"type": "string",
|
|
"title": "Started At",
|
|
"format": "date-time"
|
|
},
|
|
"completed_at": {
|
|
"type": "string",
|
|
"title": "Completed At",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"HTTPValidationError": {
|
|
"type": "object",
|
|
"title": "HTTPValidationError",
|
|
"properties": {
|
|
"detail": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ValidationError"
|
|
},
|
|
"title": "Detail"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |