Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,9 +2,9 @@ import sys
|
|
| 2 |
import gradio as gr
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
|
| 9 |
def image_to_prompt(image):
|
| 10 |
"""Generates a caption (prompt) from an image using Vertex AI."""
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
+
import vertexai
|
| 6 |
+
from vertexai.preview.vision_models import ImageCaptioningModel #Correct Import
|
| 7 |
+
vertexai.init(project=PROJECT_ID, location=LOCATION)
|
| 8 |
|
| 9 |
def image_to_prompt(image):
|
| 10 |
"""Generates a caption (prompt) from an image using Vertex AI."""
|