Update app.py
Browse files
app.py
CHANGED
@@ -62,25 +62,13 @@ def generate_gemini_response(input_prompt, text_input, image_loc):
|
|
62 |
response = model.generate_content(prompt_parts)
|
63 |
return response.text
|
64 |
|
65 |
-
input_prompt = """
|
66 |
-
Given the context and an uploaded image, your task is to create a captivating caption or post content that resonates with the selected social media platform's audience.
|
67 |
-
Please analyze the provided image and the contextual description carefully. Use the following guidelines based on the social media platform specified:
|
68 |
-
|
69 |
-
1. **Instagram**: Focus on visually appealing, inspirational, and trendy content. Use relevant hashtags.
|
70 |
-
2. **Facebook**: Craft engaging and personal stories or updates. Aim for a friendly and conversational tone.
|
71 |
-
3. **Twitter**: Create concise, witty, and impactful tweets. Utilize popular hashtags and mentions.
|
72 |
-
4. **LinkedIn**: Develop professional and insightful posts. Emphasize expertise, industry relevance, and networking.
|
73 |
-
5. **Pinterest**: Write creative and informative descriptions. Highlight the aesthetic and practical aspects.
|
74 |
-
|
75 |
-
Output should be one after another caption/post (bulleted in case of more than 1)
|
76 |
-
|
77 |
-
The prompted message is: """
|
78 |
|
79 |
def upload_file(files, text_input, social_media_platform, num_captions=1):
|
80 |
if not files:
|
81 |
return None, "Image not uploaded"
|
82 |
file_paths = [file.name for file in files]
|
83 |
-
response = generate_gemini_response(input_prompt + f"
|
84 |
return file_paths[0], response
|
85 |
|
86 |
with gr.Blocks() as demo:
|
|
|
62 |
response = model.generate_content(prompt_parts)
|
63 |
return response.text
|
64 |
|
65 |
+
input_prompt = """ Give the plate and the color of the car """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
def upload_file(files, text_input, social_media_platform, num_captions=1):
|
68 |
if not files:
|
69 |
return None, "Image not uploaded"
|
70 |
file_paths = [file.name for file in files]
|
71 |
+
response = generate_gemini_response(input_prompt + f"Number of Captions/Posts: {num_captions}\n", text_input, file_paths[0])
|
72 |
return file_paths[0], response
|
73 |
|
74 |
with gr.Blocks() as demo:
|