Spaces:
Runtime error
Runtime error
Commit ·
988eca2
1
Parent(s): 3713dd0
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,15 +30,16 @@ def genrate_caption(image_file):
|
|
| 30 |
output_text = processor.decode(output_ids[0], skip_special_tokens=True)
|
| 31 |
return output_text
|
| 32 |
|
| 33 |
-
st.title("Image Caption and HashTag
|
| 34 |
image_file = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
|
| 35 |
|
| 36 |
def creative_caption(text):
|
| 37 |
-
return co_client.generate(prompt=f"Write some trendy
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
def caption_hashtags(text):
|
| 41 |
-
return co_client.generate(prompt=f"Write
|
| 42 |
|
| 43 |
if image_file is not None:
|
| 44 |
try:
|
|
|
|
| 30 |
output_text = processor.decode(output_ids[0], skip_special_tokens=True)
|
| 31 |
return output_text
|
| 32 |
|
| 33 |
+
st.title("Image Caption and HashTag Generator")
|
| 34 |
image_file = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
|
| 35 |
|
| 36 |
def creative_caption(text):
|
| 37 |
+
return co_client.generate(prompt=f"Write some trendy, catchy, exciting, innovative, captivating, creative and
|
| 38 |
+
engaging instagram captions for the following prompt - {text}").generations[0].text
|
| 39 |
|
| 40 |
|
| 41 |
def caption_hashtags(text):
|
| 42 |
+
return co_client.generate(prompt=f"Write 10 trendy instagram hashtags for the following prompt - {text}").generations[0].text
|
| 43 |
|
| 44 |
if image_file is not None:
|
| 45 |
try:
|