Spaces:
Running
Running
samiee2213
commited on
Commit
•
69a0a8d
1
Parent(s):
8d9ce93
Update app.py
Browse files
app.py
CHANGED
@@ -21,6 +21,11 @@ warnings.filterwarnings("ignore", category=DeprecationWarning)
|
|
21 |
# Load environment variables
|
22 |
load_dotenv()
|
23 |
st.set_page_config(page_title="MindMate", layout="wide", initial_sidebar_state="expanded")
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# CSS styles
|
26 |
css = '''
|
@@ -433,42 +438,8 @@ def sidebar():
|
|
433 |
)
|
434 |
|
435 |
# API Key and Model Selection
|
436 |
-
st.
|
437 |
-
|
438 |
-
selected_model = st.sidebar.selectbox('Select Model', models)
|
439 |
-
|
440 |
-
api_key = st.sidebar.text_input('Enter API Key', type='password')
|
441 |
-
|
442 |
-
if selected_model == 'Azure':
|
443 |
-
endpoint = st.sidebar.text_input("Enter endpoint", type="url")
|
444 |
-
deployment_name = st.sidebar.text_input("Enter deployment name")
|
445 |
-
|
446 |
-
if st.sidebar.button('Run Model'):
|
447 |
-
st.session_state['api_key'] = api_key
|
448 |
-
|
449 |
-
if selected_model == '3.5 Turbo':
|
450 |
-
st.session_state['chat'] = ChatOpenAI(temperature=0, model="gpt-3.5-turbo", api_key=api_key)
|
451 |
-
elif selected_model == 'Azure':
|
452 |
-
st.session_state['chat'] = AzureChatOpenAI(
|
453 |
-
azure_endpoint=endpoint,
|
454 |
-
deployment_name=deployment_name,
|
455 |
-
openai_api_version="2023-03-15-preview",
|
456 |
-
api_key=api_key,
|
457 |
-
openai_api_type="Azure"
|
458 |
-
)
|
459 |
-
elif selected_model == '4.0':
|
460 |
-
st.session_state['chat'] = ChatOpenAI(temperature=0, model="gpt-4.0", api_key=api_key)
|
461 |
-
elif selected_model == 'Gemini':
|
462 |
-
st.session_state['chat'] = ChatGoogleGenerativeAI(model="gemini-1.5-pro",temperature=0,api_key=api_key,convert_system_message_to_human=True)
|
463 |
-
elif selected_model == 'Ollama':
|
464 |
-
st.session_state['chat'] = ChatOpenAI(temperature=0, model="ollama-1", api_key=api_key)
|
465 |
-
elif selected_model == 'Mistral':
|
466 |
-
st.session_state['chat'] = ChatOpenAI(temperature=0, model="mistral-1", api_key=api_key)
|
467 |
-
else:
|
468 |
-
st.error('Invalid model selection')
|
469 |
-
return
|
470 |
-
|
471 |
-
st.success(f'Model {selected_model} is running...')
|
472 |
|
473 |
return selected_page.split(" ", 1)[1]
|
474 |
|
@@ -1232,7 +1203,7 @@ elif page == "How to use?":
|
|
1232 |
</div>
|
1233 |
<div class="section">
|
1234 |
<h3>🛠️ Tools:</h3>
|
1235 |
-
<ul>
|
1236 |
<li>Interactive exercises based on cognitive-behavioral therapy.</li>
|
1237 |
<li>Use these tools to solve problems, set goals, and more.</li>
|
1238 |
</ul>
|
|
|
21 |
# Load environment variables
|
22 |
load_dotenv()
|
23 |
st.set_page_config(page_title="MindMate", layout="wide", initial_sidebar_state="expanded")
|
24 |
+
api_key = os.getenv('GEMINI_API_KEY')
|
25 |
+
|
26 |
+
|
27 |
+
# Initialize Orkes Client
|
28 |
+
orkes_client = conductor.Conductor(api_key=orkes_api_key, api_secret=orkes_api_secret, server_url=orkes_server_url)
|
29 |
|
30 |
# CSS styles
|
31 |
css = '''
|
|
|
438 |
)
|
439 |
|
440 |
# API Key and Model Selection
|
441 |
+
st.session_state['chat'] = ChatGoogleGenerativeAI(model="gemini-1.5-pro",temperature=0,api_key=api_key,convert_system_message_to_human=True)
|
442 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
443 |
|
444 |
return selected_page.split(" ", 1)[1]
|
445 |
|
|
|
1203 |
</div>
|
1204 |
<div class="section">
|
1205 |
<h3>🛠️ Tools:</h3>
|
1206 |
+
<ul>
|
1207 |
<li>Interactive exercises based on cognitive-behavioral therapy.</li>
|
1208 |
<li>Use these tools to solve problems, set goals, and more.</li>
|
1209 |
</ul>
|