add stars
Browse files- app/app.py +14 -1
- core/utils.py +0 -1
app/app.py
CHANGED
@@ -1,14 +1,22 @@
|
|
|
|
1 |
import time
|
2 |
import streamlit as st
|
3 |
from core.generation_utils import generate_answer, load_llm
|
4 |
from core.types import ThoughtStepsDisplay, BigMessage
|
5 |
from .app_config import InputConfig, ENV_FILE_PATH, CONFIG_FILE_PATH
|
6 |
import litellm
|
|
|
|
|
7 |
|
8 |
-
|
|
|
9 |
|
10 |
|
11 |
def config_sidebar(config:InputConfig) -> InputConfig:
|
|
|
|
|
|
|
|
|
12 |
st.sidebar.header('Configuration')
|
13 |
model_name = st.sidebar.text_input('Model Name: e.g. provider/model-name',value=config.model_name, placeholder='openai/gpt-3.5-turbo')
|
14 |
model_api_key = st.sidebar.text_input('API Key: ',type='password',value=config.model_api_key, placeholder='sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
|
@@ -32,6 +40,11 @@ def config_sidebar(config:InputConfig) -> InputConfig:
|
|
32 |
if st.sidebar.button('Save config'):
|
33 |
config.save(env_file=ENV_FILE_PATH, config_file=CONFIG_FILE_PATH)
|
34 |
st.sidebar.success('Config saved!')
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
return config
|
37 |
|
|
|
1 |
+
from operator import call
|
2 |
import time
|
3 |
import streamlit as st
|
4 |
from core.generation_utils import generate_answer, load_llm
|
5 |
from core.types import ThoughtStepsDisplay, BigMessage
|
6 |
from .app_config import InputConfig, ENV_FILE_PATH, CONFIG_FILE_PATH
|
7 |
import litellm
|
8 |
+
import os
|
9 |
+
import webbrowser
|
10 |
|
11 |
+
def star_repo():
|
12 |
+
webbrowser.open("https://github.com/tikendraw/open-o1")
|
13 |
|
14 |
|
15 |
def config_sidebar(config:InputConfig) -> InputConfig:
|
16 |
+
|
17 |
+
_ = st.button("Star the Repo!", callback=star_repo)
|
18 |
+
|
19 |
+
|
20 |
st.sidebar.header('Configuration')
|
21 |
model_name = st.sidebar.text_input('Model Name: e.g. provider/model-name',value=config.model_name, placeholder='openai/gpt-3.5-turbo')
|
22 |
model_api_key = st.sidebar.text_input('API Key: ',type='password',value=config.model_api_key, placeholder='sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
|
|
|
40 |
if st.sidebar.button('Save config'):
|
41 |
config.save(env_file=ENV_FILE_PATH, config_file=CONFIG_FILE_PATH)
|
42 |
st.sidebar.success('Config saved!')
|
43 |
+
|
44 |
+
if st.sidebar.button('Delete Key'):
|
45 |
+
os.remove(ENV_FILE_PATH)
|
46 |
+
config.model_api_key = ''
|
47 |
+
st.sidebar.success('Key deleted!')
|
48 |
|
49 |
return config
|
50 |
|
core/utils.py
CHANGED
@@ -3,7 +3,6 @@
|
|
3 |
import re
|
4 |
import json
|
5 |
import ast
|
6 |
-
from turtle import color
|
7 |
from pydantic import ValidationError
|
8 |
from termcolor import colored
|
9 |
|
|
|
3 |
import re
|
4 |
import json
|
5 |
import ast
|
|
|
6 |
from pydantic import ValidationError
|
7 |
from termcolor import colored
|
8 |
|