Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sajjadrahman56 committed Dec 25, 2023
1 parent e5a70d2 commit a7595c3
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,10 @@ def get_gemini_response(input,image):

## If ask button is clicked

if submit:

if submit:
response=get_gemini_response(input,image)
st.subheader("The Response is")
st.write(response)


# from dotenv import load_dotenv
# load_dotenv()

Expand All @@ -59,22 +56,22 @@ def get_gemini_response(input,image):
# import google.generativeai as genai

# genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
# model = genai.GenerativeModel("gemini-pro")
model = genai.GenerativeModel("gemini-pro")

# def get_response(input_text):
# response = model.generate_content(input_text)
# return response.text
def get_response(input_text):
response = model.generate_content(input_text)
return response.text

# st.set_page_config(page_title="Q & A", page_icon=":gem:")
st.set_page_config(page_title="Q & A", page_icon=":gem:")

# st.header("Here you GO...!")
# input = st.text_input("Enter your question here", key="input")
st.header("Here you GO...!")
input = st.text_input("Enter your question here", key="input")

# input = st.text_input("Enter your question here", key="input")
# submit = st.button("Submit")
input = st.text_input("Enter your question here", key="input")
submit = st.button("Submit")


# if submit:
# response = get_response(input)
# st.subheader("The Response is :")
# st.write(response)
if submit:
response = get_response(input)
st.subheader("The Response is :")
st.write(response)

0 comments on commit a7595c3

Please sign in to comment.