Spaces:
Running
Running
Commit
·
8606aa2
1
Parent(s):
4c02f0a
change the prompt
Browse files
app.py
CHANGED
|
@@ -18,12 +18,10 @@ image_to_text = TransformersImageToText(
|
|
| 18 |
)
|
| 19 |
|
| 20 |
prompt_template = PromptTemplate(prompt="""
|
| 21 |
-
You will receive a
|
| 22 |
-
Try to come up with a nice Instagram caption.
|
| 23 |
-
|
| 24 |
-
The caption must rhyme with the describing text and needs to include one emoji and suitable hastags
|
| 25 |
|
| 26 |
-
|
| 27 |
Caption:
|
| 28 |
""")
|
| 29 |
|
|
@@ -42,6 +40,7 @@ def generate_caption(image_file_paths):
|
|
| 42 |
with gr.Blocks(theme="soft") as demo:
|
| 43 |
gr.Markdown(value=description)
|
| 44 |
image = gr.Image(type="filepath")
|
|
|
|
| 45 |
submit_btn = gr.Button("✨ Captionate ✨")
|
| 46 |
caption = gr.Textbox(label="Caption")
|
| 47 |
submit_btn.click(fn=generate_caption, inputs=[image], outputs=[caption])
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
prompt_template = PromptTemplate(prompt="""
|
| 21 |
+
You will receive a descriptive text of a photo.
|
| 22 |
+
Try to come up with a nice Instagram caption that has a phrase rhyming with the text.
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
Descriptive text:{documents};
|
| 25 |
Caption:
|
| 26 |
""")
|
| 27 |
|
|
|
|
| 40 |
with gr.Blocks(theme="soft") as demo:
|
| 41 |
gr.Markdown(value=description)
|
| 42 |
image = gr.Image(type="filepath")
|
| 43 |
+
# model_name = gr.Dropdown(["tiiuae/falcon-7b-instruct", "gpt-3.5-turbo", "gpt-4", "gpt-4-32k", "command", "command-light", "base", "base-light"], value="tiiuae/falcon-7b-instruct", label="Choose your model!")
|
| 44 |
submit_btn = gr.Button("✨ Captionate ✨")
|
| 45 |
caption = gr.Textbox(label="Caption")
|
| 46 |
submit_btn.click(fn=generate_caption, inputs=[image], outputs=[caption])
|