Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,19 +56,19 @@ def input_image_setup(file_loc):
|
|
56 |
]
|
57 |
return image_parts
|
58 |
|
59 |
-
def generate_gemini_response(input_prompt
|
60 |
image_prompt = input_image_setup(image_loc)
|
61 |
-
prompt_parts = [input_prompt
|
62 |
response = model.generate_content(prompt_parts)
|
63 |
return response.text
|
64 |
|
65 |
-
input_prompt = """
|
66 |
|
67 |
-
def upload_file(files):
|
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, file_paths[0])
|
72 |
return file_paths[0], response
|
73 |
|
74 |
with gr.Blocks() as demo:
|
|
|
56 |
]
|
57 |
return image_parts
|
58 |
|
59 |
+
def generate_gemini_response(input_prompt,, image_loc):
|
60 |
image_prompt = input_image_setup(image_loc)
|
61 |
+
prompt_parts = [input_prompt image_prompt[0]]
|
62 |
response = model.generate_content(prompt_parts)
|
63 |
return response.text
|
64 |
|
65 |
+
input_prompt = """ give the plate, the model and the color of the car """
|
66 |
|
67 |
+
def upload_file(files, 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"\nPlatform: {social_media_platform}\n"+ f"Number of Captions/Posts: {num_captions}\n", file_paths[0])
|
72 |
return file_paths[0], response
|
73 |
|
74 |
with gr.Blocks() as demo:
|