gemini-x / app.py
adil9858's picture
Update app.py
b8e6b8c
raw
history blame
No virus
725 Bytes
import streamlit as st
import google.generativeai as genai
# Configure Google GenAI
api_key = 'AIzaSyA7jXPscK6XqztKHkZB-QDE_OjpEzZQDCU'
genai.configure(api_key=api_key)
# Initialize GenerativeModel
model = genai.GenerativeModel('gemini-pro')
# Streamlit app
st.title("Hugging Face Space with Streamlit")
# Input text box for user query
user_query = st.text_input("Enter your query:")
if st.button("Generate"):
# Generate content using the model
response = model.generate_content(user_query)
# Display the generated content using Markdown
st.markdown(response.text)
# Run the app
if __name__ == "__main__":
st.set_page_config(page_title="Hugging Face Space", page_icon=":rocket:")
st.run_app()