import streamlit as st import google-generativeai as genAi from PIL import Image genAi.configure(api_key="AIzaSyBZQmot8_8bDxuGiffJ06woJCzH140Erc4str") def get_response(inputt,image): model=genAi.GenerativeModel('gemini-pro-vision') if inputt!="": response=model.generate_content([inputt,image]) else: # response=model.generate_content([image]) response=model.generate_content(image) return response.text st.header("PROJECT") input=st.text_input("Input Prompt",key='input') upload_file=st.file_uploader("Choose yout file",type=['jpg','jpeg','png']) image='' if upload_file is not None: image=Image.open(upload_file) st.image(image,caption="uploaded_image",use_column_width=True) submit=st.button("ASK") if submit: response=get_response(input,image) st.write(response)