Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# Define Roles and their Descriptions
|
4 |
+
roles = {
|
5 |
+
"Writing Expert": "๐ Exhibits expertise in generating textual content and narratives.",
|
6 |
+
"Roleplay Expert": "๐ญ Specialized in mimicking behaviors or characters.",
|
7 |
+
"Extraction Expert": "๐ Strictly sticks to facts and extracts concise information.",
|
8 |
+
"Mathematician": "โ Solves mathematical problems with precision.",
|
9 |
+
"Coder": "๐ป Creates short python code functions to solve tasks.",
|
10 |
+
"Reasoning Expert": "๐ค Analyzes situations and provides logical solutions.",
|
11 |
+
"STEM Expert": "๐ฌ Specialized in Science, Technology, Engineering, and Mathematics tasks.",
|
12 |
+
"Humanities Expert": "๐ Focuses on arts, literature, history, and other humanities subjects.",
|
13 |
+
}
|
14 |
+
|
15 |
+
# Streamlit UI
|
16 |
+
st.title("AI Role Selector")
|
17 |
+
|
18 |
+
Roles='''
|
19 |
+
1. ๐ Writing
|
20 |
+
What it means: This role is about creating text or stories. AI can help write essays, stories, or even poems!
|
21 |
+
2. ๐ญ Roleplay
|
22 |
+
What it means: Just like playing pretend, AI can pretend to be someone or something else to understand situations better.
|
23 |
+
3. ๐ Extraction
|
24 |
+
What it means: Extraction is like a treasure hunt! It's about pulling out special pieces of information from a big pile.
|
25 |
+
4. โ Math
|
26 |
+
What it means: This is all about numbers, calculations, and solving math problems.
|
27 |
+
5. ๐ป Coding
|
28 |
+
What it means: Coding is giving instructions to the computer. It's like teaching it a new trick!
|
29 |
+
6. ๐ค Reasoning
|
30 |
+
What it means: Reasoning is about thinking things through, like solving a puzzle or mystery.
|
31 |
+
7. ๐ฌ STEM
|
32 |
+
What it means: STEM stands for Science, Technology, Engineering, and Math. It's all about exploring, building, and discovering!
|
33 |
+
8. ๐ Humanities
|
34 |
+
What it means: Humanities is about understanding people, cultures, and stories. It's like traveling back in time!
|
35 |
+
|
36 |
+
'''
|
37 |
+
|
38 |
+
# Dropdown to select role
|
39 |
+
selected_role = st.selectbox("Select AI Role:", list(roles.keys()))
|
40 |
+
|
41 |
+
# Slider to adjust sampling temperature
|
42 |
+
temperature = st.slider("Adjust Sampling Temperature:", 0.0, 1.0, temperature_config[selected_role.split(' ')[0].lower()])
|
43 |
+
|
44 |
+
# Switch to choose between two models
|
45 |
+
model = st.radio("Choose Model:", ["model_1", "model_2"])
|
46 |
+
|
47 |
+
# Text area for user input
|
48 |
+
user_input = st.text_area("Provide your task/question:")
|
49 |
+
|
50 |
+
# Button to execute
|
51 |
+
if st.button("Execute"):
|
52 |
+
# Here, you would add code to get the AI response based on the selected role, temperature, and model.
|
53 |
+
# For now, just echoing the user input.
|
54 |
+
st.write(f"You said: {user_input}")
|
55 |
+
|
56 |
+
# Display the description of the selected role
|
57 |
+
st.write(roles[selected_role])
|