Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,6 @@ captioning_client = Client(CAPTION_SPACE)
|
|
| 26 |
llm_client = Client(LLM_SPACE)
|
| 27 |
|
| 28 |
def generate_compliment(image):
|
| 29 |
-
compliment_text = ""
|
| 30 |
try:
|
| 31 |
# Convert PIL image to bytes
|
| 32 |
buffered = io.BytesIO()
|
|
@@ -42,7 +41,8 @@ def generate_compliment(image):
|
|
| 42 |
compliment_text = llm_response.data[0]
|
| 43 |
|
| 44 |
except Exception as e:
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
return caption_text, compliment_text
|
| 48 |
|
|
@@ -55,7 +55,8 @@ iface = gr.Interface(
|
|
| 55 |
gr.Textbox(label="Compliment")
|
| 56 |
],
|
| 57 |
title="Compliment Bot π",
|
| 58 |
-
description="Upload your headshot and get a personalized compliment!"
|
|
|
|
| 59 |
)
|
| 60 |
|
| 61 |
iface.launch()
|
|
|
|
| 26 |
llm_client = Client(LLM_SPACE)
|
| 27 |
|
| 28 |
def generate_compliment(image):
|
|
|
|
| 29 |
try:
|
| 30 |
# Convert PIL image to bytes
|
| 31 |
buffered = io.BytesIO()
|
|
|
|
| 41 |
compliment_text = llm_response.data[0]
|
| 42 |
|
| 43 |
except Exception as e:
|
| 44 |
+
caption_text = f"Error: Failed to get caption. Exception: {str(e)}"
|
| 45 |
+
compliment_text = "Error: Failed to generate compliment."
|
| 46 |
|
| 47 |
return caption_text, compliment_text
|
| 48 |
|
|
|
|
| 55 |
gr.Textbox(label="Compliment")
|
| 56 |
],
|
| 57 |
title="Compliment Bot π",
|
| 58 |
+
description="Upload your headshot and get a personalized compliment!",
|
| 59 |
+
share=True # Setting share=True to create a public link
|
| 60 |
)
|
| 61 |
|
| 62 |
iface.launch()
|