diff --git a/app_config.json b/app_config.json index 045835810..05188bb86 100644 --- a/app_config.json +++ b/app_config.json @@ -1,12 +1,20 @@ { - "deepseek":{ + "deepseek-chat":{ "api_url": "https://api.deepseek.com", - "api_key": "sk-12165b127043441697a8940918e207ac" + "api_key": "sk-12165b127043441697a8940918e207ac", + "model":"deepseek-chat" }, - "ollama":{ + "llama3.2:1b":{ "api_url": "http://localhost:11434/v1", - "api_key": "ollama" + "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": { diff --git a/data/MNIST/raw/t10k-images-idx3-ubyte b/data/MNIST/raw/t10k-images-idx3-ubyte new file mode 100644 index 000000000..1170b2cae Binary files /dev/null and b/data/MNIST/raw/t10k-images-idx3-ubyte differ diff --git a/data/MNIST/raw/t10k-images-idx3-ubyte.gz b/data/MNIST/raw/t10k-images-idx3-ubyte.gz new file mode 100644 index 000000000..5ace8ea93 Binary files /dev/null and b/data/MNIST/raw/t10k-images-idx3-ubyte.gz differ diff --git a/data/MNIST/raw/t10k-labels-idx1-ubyte b/data/MNIST/raw/t10k-labels-idx1-ubyte new file mode 100644 index 000000000..d1c3a9706 Binary files /dev/null and b/data/MNIST/raw/t10k-labels-idx1-ubyte differ diff --git a/data/MNIST/raw/t10k-labels-idx1-ubyte.gz b/data/MNIST/raw/t10k-labels-idx1-ubyte.gz new file mode 100644 index 000000000..a7e141541 Binary files /dev/null and b/data/MNIST/raw/t10k-labels-idx1-ubyte.gz differ diff --git a/data/MNIST/raw/train-images-idx3-ubyte b/data/MNIST/raw/train-images-idx3-ubyte new file mode 100644 index 000000000..bbce27659 Binary files /dev/null and b/data/MNIST/raw/train-images-idx3-ubyte differ diff --git a/data/MNIST/raw/train-images-idx3-ubyte.gz b/data/MNIST/raw/train-images-idx3-ubyte.gz new file mode 100644 index 000000000..b50e4b6bc Binary files /dev/null and b/data/MNIST/raw/train-images-idx3-ubyte.gz differ diff --git a/data/MNIST/raw/train-labels-idx1-ubyte b/data/MNIST/raw/train-labels-idx1-ubyte new file mode 100644 index 000000000..d6b4c5db3 Binary files /dev/null and b/data/MNIST/raw/train-labels-idx1-ubyte differ diff --git a/data/MNIST/raw/train-labels-idx1-ubyte.gz b/data/MNIST/raw/train-labels-idx1-ubyte.gz new file mode 100644 index 000000000..707a576bb Binary files /dev/null and b/data/MNIST/raw/train-labels-idx1-ubyte.gz differ diff --git a/experiment.py b/experiment.py new file mode 100644 index 000000000..e69de29bb diff --git a/mnist_cnn.pth b/mnist_cnn.pth new file mode 100644 index 000000000..fed711f1a Binary files /dev/null and b/mnist_cnn.pth differ diff --git a/mnist_cnn_improved.pth b/mnist_cnn_improved.pth new file mode 100644 index 000000000..a7d8843fc Binary files /dev/null and b/mnist_cnn_improved.pth differ diff --git a/webpages/__pycache__/buff_bot.cpython-312.pyc b/webpages/__pycache__/buff_bot.cpython-312.pyc index 1959f9c2d..3698f3c8b 100644 Binary files a/webpages/__pycache__/buff_bot.cpython-312.pyc and b/webpages/__pycache__/buff_bot.cpython-312.pyc differ diff --git a/webpages/__pycache__/home.cpython-312.pyc b/webpages/__pycache__/home.cpython-312.pyc index 8591948ab..2c8b7212c 100644 Binary files a/webpages/__pycache__/home.cpython-312.pyc and b/webpages/__pycache__/home.cpython-312.pyc differ diff --git a/webpages/__pycache__/testing.cpython-312.pyc b/webpages/__pycache__/testing.cpython-312.pyc index ab1531f6c..3dbd45e83 100644 Binary files a/webpages/__pycache__/testing.cpython-312.pyc and b/webpages/__pycache__/testing.cpython-312.pyc differ diff --git a/webpages/buff_bot.py b/webpages/buff_bot.py index d368220ea..469daa840 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 = ["llama3.2:1b", "deepseek-chat", ] + model_options = ["deepseek-r1:1.5b", "llama3.2:1b", "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) @@ -36,26 +36,35 @@ def buffbot(): # Load API credentials from config.json # the config file contains the API key and base URL for the selected model - """ - { - "deepseek":{ - "api_url": "https://api.deepseek.com", - "api_key": "YOUR_API_KEY" - }, - - "ollama":{ - "api_url": "http://localhost:11434/v1", - "api_key": "ollama" - } - } - """ + """ + { + "deepseek":{ + "api_url": "https://api.deepseek.com", + "api_key": "YOUR_API_KEY", + "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" + }, + } + """ # 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) # deepseek-chat model, online API if selected_model == "deepseek-chat": - api_base_url = config["deepseek"]["api_url"] - api_key = config["deepseek"]["api_key"] + api_base_url = config[selected_model]["api_url"] + api_key = config[selected_model]["api_key"] + model = config[selected_model]["model"] st.info("Powered by the online [DeepSeek](https://www.deepseek.com/) API!\ Just a heads up, you have 10 messages to use.") # Set the maximum number of user messages @@ -63,11 +72,20 @@ def buffbot(): # llama3.2:1b model, local API if selected_model == "llama3.2:1b": - api_base_url = config["ollama"]["api_url"] - api_key = config["ollama"]["api_key"] + api_base_url = config[selected_model]["api_url"] + api_key = config[selected_model]["api_key"] + model = config[selected_model]["model"] st.info("Powered by local llama3.2:1b model via [Ollama](https://ollama.com/library/llama3.2:1b)!\ Just a heads up, you have 100 messages to use.") - MAX_USER_MESSAGES = 100 + MAX_USER_MESSAGES = 100 + + if selected_model == "deepseek-r1:1.5b": + api_base_url = config[selected_model]["api_url"] + api_key = config[selected_model]["api_key"] + model = config[selected_model]["model"] + st.info("Powered by local deepseek-r1:1.5b model via [Ollama](https://ollama.com/library/deepseek-r1:1.5b)!\ + Just a heads up, you have 100 messages to use.") + MAX_USER_MESSAGES = 100 # Initialize OpenAI client to connect with the selected model API client = OpenAI(api_key=api_key, base_url=api_base_url) diff --git a/webpages/home.py b/webpages/home.py index 422bb9530..ef0cbcce8 100644 --- a/webpages/home.py +++ b/webpages/home.py @@ -104,7 +104,8 @@ def home(): """, unsafe_allow_html=True) # Faculty Advisors - st.markdown(""" + st.markdown( + """

Faculty Advisors

diff --git a/webpages/testing.py b/webpages/testing.py index 956ddfac5..025c33061 100644 --- a/webpages/testing.py +++ b/webpages/testing.py @@ -1,14 +1,5 @@ import streamlit as st from webpages.SendEmail import send_email -# # Example usage of the send_email function -# if __name__ == "__main__": -# send_email( -# sender_email="noreply@buffteks.org", # Sender's email address -# password="cidm4360fall2024@*", # Sender's email password -# to_email="REPLACE_WITH_RESIDENT_EMAIL", # Recipient's email address -# subject="Package Pickup Notification", # Subject of the email -# ) - def testing(): st.write("Testing Page")