diff --git a/.gitignore b/.gitignore index e155a8b0f..0c0e4354e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ new_members.json files/student_locations.db -venv/ -__pycache__/ \ No newline at end of file +*venv/ +__pycache__/ +*.pyc \ No newline at end of file diff --git a/.streamlit/config.toml b/.streamlit/config.toml new file mode 100644 index 000000000..5398a5deb --- /dev/null +++ b/.streamlit/config.toml @@ -0,0 +1,2 @@ +[server] +maxUploadSize = 10 \ No newline at end of file diff --git a/app_config.json b/app_config.json index c06a962c9..0ba6aa9de 100644 --- a/app_config.json +++ b/app_config.json @@ -1,12 +1,12 @@ { - "gemini-2.0-flash":{ + "gemini-2.5-flash-lite":{ "api_url": "https://generativelanguage.googleapis.com/v1beta/openai/", "api_key": "AIzaSyCiURTUJrEGw5J7HxtL1KRNT9GhNKCJsb0", - "model": "gemini-2.0-flash" + "model": "gemini-2.5-flash-lite" }, "nano-banana":{ - "api_url": "https://generativelanguage.googleapis.com/v1beta/openai/", + "api_key": "AIzaSyCiURTUJrEGw5J7HxtL1KRNT9GhNKCJsb0", "model": "gemini-2.5-flash-image-preview" }, @@ -16,18 +16,6 @@ "api_key": "sk-12165b127043441697a8940918e207ac", "model":"deepseek-chat" }, - - "llama3.2:1b":{ - "api_url": "http://localhost:11434/v1", - "api_key": "ollama", - "model":"llama3.2:1b" - }, - - "deepseek-r1:1.5b":{ - "api_url": "http://localhost:11434/v1", - "api_key": "ollama", - "model":"deepseek-r1:1.5b" - }, "send_email": { "sender_email": "noreply@buffteks.org", diff --git a/webpages/buff_bot.py b/webpages/buff_bot.py index cbbc195d9..d04224a29 100644 --- a/webpages/buff_bot.py +++ b/webpages/buff_bot.py @@ -23,7 +23,7 @@ def buffbot(): st.code(f.read(), language="python") st.divider() # Select AI model for chatbot - model_options = ["gemini-2.0-flash", "deepseek-r1:1.5b", "llama3.2:1b", "deepseek-chat", ] + model_options = ["gemini-2.5-flash-lite", "deepseek-chat", ] # on_change callback to clear chat history when model is changed selected_model = st.selectbox("**👉Please select a model to start**", model_options, on_change=clear_chat) @@ -44,32 +44,18 @@ def buffbot(): "model":"deepseek-chat" }, - "ollama3.2:1b":{ - "api_url": "http://localhost:11434/v1", - "api_key": "ollama", - "model":"llama3.2:1b" - }, - - "deepseek-r1:1.5b":{ - "api_url": "http://localhost:11434/v1", - "api_key": "ollama", - "model":"deepseek-r1:1.5b" - }, + "gemini-2.0-flash":{ + "api_key": "YOUR_API_KEY", + "model": "gemini-2.0-flash" + }, + } """ # The API key and base URL are loaded based on the selected model with open('app_config.json') as config_file: config = json.load(config_file) - if selected_model == "grok-3": - api_base_url = config[selected_model]["api_url"] - api_key = config[selected_model]["api_key"] - st.info("Powered by the online [Grok](https://www.grok.com/) API!\ - Just a heads up, you have 20 messages to use.") - # Set the maximum number of user messages - MAX_USER_MESSAGES = 20 - - if selected_model == "gemini-2.0-flash": + if selected_model == "gemini-2.5-flash-lite": api_base_url = config[selected_model]["api_url"] api_key = config[selected_model]["api_key"] st.info("Powered by the online [Gemini](https://deepmind.google/technologies/gemini/) API!\ diff --git a/webpages/bufftools_pages/ai_image_editor.py b/webpages/bufftools_pages/ai_image_editor.py index c5740f114..46bd96e31 100644 --- a/webpages/bufftools_pages/ai_image_editor.py +++ b/webpages/bufftools_pages/ai_image_editor.py @@ -35,9 +35,9 @@ def edit_image_with_ai(image, description): def ai_image_editor(): st.markdown("

AI Image Editor🖼️

", unsafe_allow_html=True) st.markdown("
Edit and enhance your images with the power of AI! 🎨
", unsafe_allow_html=True) - st.info("Powered by the online [Gemini Image Generation](https://ai.google.dev/gemini-api/docs/image-generation) API!") + st.info("Powered by the online [Gemini Image Generation](https://ai.google.dev/gemini-api/docs/image-generation) API! ⚠️ No images or descriptions are stored.") # user upload an image and provide a description of the edit they want - uploaded_image = st.file_uploader("Upload an image to edit", type=["png", "jpg", "jpeg"]) + uploaded_image = st.file_uploader("Upload an image to edit", type=["png", "jpg", "jpeg"], help="Choose an image file (PNG, JPG, JPEG) to upload.") if uploaded_image is not None: with st.spinner("Loading image..."): # display the uploaded image @@ -45,7 +45,19 @@ def ai_image_editor(): st.image(image, width= 300) st.success("Image uploaded successfully!") - edit_description = st.text_area("Describe the edits you want to make to the image") + reference_prompt = """ + Please edit the uploaded image to create a professional profile photo of the person in the picture. Focus on the following: + - Outfit: Transform the current attire into a fitted, black professional suit. Ensure the fit is flattering and appropriate for a software engineer headshot. Change glasses to frameless fashion glasses. Change tie color to deep blue + - Facial Features & Hair: Retain the original facial features (eyes, nose, mouth, etc.) and individual hair strands as much as possible. The goal is to achieve a realistic, edited look, not an AI-generated or overly smoothed/perfected appearance. Avoid any artificial alterations to these features. + - Pose Adjustment: Adjust the pose so that the face is facing forward. Make subtle corrections to the body posture to appear slightly straightened and more upright. + - Framing & Composition: Crop the image as a half-body portrait. Ensure the head and shoulders are well-framed. + - Background & Lighting: Use a neutral, non-distracting background (e.g., soft gray). Apply soft, natural lighting to create a professional and inviting look. Avoid harsh shadows or overly bright highlights. + - Overall Style: The final image should be photorealistic and suitable for a professional profile. It should project professionalism and competence. + """ + with st.expander("See Example Prompt for Professional Profile Photo"): + st.markdown(reference_prompt) + st.info("Note: The example prompt is for reference only. You can provide your own description of the edits you want to make to the image. Gemini Official Prompting Guide and Strategies: https://ai.google.dev/gemini-api/docs/image-generation#prompt-guide") + edit_description = st.text_area("Describe the edits you want to make to the image", height="content",) if st.button("AI Editing"): if edit_description.strip() == "": st.error("Please provide a description of the edits you want to make.")