Add deepseek local model deepseek-r1:1.5b

This commit is contained in:
BuffTechTalk
2025-01-27 13:53:41 -06:00
parent 340c66dfac
commit 6ed8d0dda9
18 changed files with 51 additions and 33 deletions

View File

@@ -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": {

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
experiment.py Normal file
View File

BIN
mnist_cnn.pth Normal file

Binary file not shown.

BIN
mnist_cnn_improved.pth Normal file

Binary file not shown.

View File

@@ -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)
@@ -40,13 +40,21 @@ def buffbot():
{
"deepseek":{
"api_url": "https://api.deepseek.com",
"api_key": "YOUR_API_KEY"
"api_key": "YOUR_API_KEY",
"model":"deepseek-chat"
},
"ollama":{
"ollama3.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"
},
}
"""
# The API key and base URL are loaded based on the selected model
@@ -54,8 +62,9 @@ def buffbot():
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,12 +72,21 @@ 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
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)

View File

@@ -104,7 +104,8 @@ def home():
""", unsafe_allow_html=True)
# Faculty Advisors
st.markdown("""
st.markdown(
"""
<section>
<h2>Faculty Advisors</h2>
<div class="faculty-container">

View File

@@ -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")