Update app.py
Browse files
app.py
CHANGED
|
@@ -53,7 +53,9 @@ def run(message: str,
|
|
| 53 |
output += response.token.text
|
| 54 |
|
| 55 |
def generate_image_caption(image_data):
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
caption = interface(image_data)
|
| 58 |
return caption
|
| 59 |
|
|
|
|
| 53 |
output += response.token.text
|
| 54 |
|
| 55 |
def generate_image_caption(image_data):
|
| 56 |
+
# Ensure the HF_TOKEN environment variable is set
|
| 57 |
+
os.environ["HF_TOKEN"] = HF_TOKEN
|
| 58 |
+
interface = gr.Interface.load("models/Salesforce/blip-image-captioning-base")
|
| 59 |
caption = interface(image_data)
|
| 60 |
return caption
|
| 61 |
|