Spaces:
Running
Running
Update ui.py
Browse files
ui.py
CHANGED
@@ -62,56 +62,81 @@ def APP():
|
|
62 |
st.markdown('<div class="blinking-text"> CAUTION ! </div>', unsafe_allow_html=True)
|
63 |
|
64 |
with tab1:
|
65 |
-
with st.form("bio",border=False):
|
66 |
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
|
74 |
|
75 |
-
|
76 |
-
|
77 |
|
78 |
|
79 |
-
#else:
|
80 |
-
bio_input = st.text_area(
|
81 |
-
"Protein Engineering Query",
|
82 |
-
placeholder="Type your query here."
|
83 |
-
)
|
84 |
-
execute_button=st.form_submit_button("execute")
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
|
97 |
|
98 |
-
|
99 |
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
|
104 |
-
|
105 |
-
|
106 |
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
-
|
114 |
st.error("Please fill in both username and project name before submitting")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
with tab2:
|
116 |
st.markdown("### newMATTER Bio Lab Operations")
|
117 |
response=requests.get(f"https://thexforce-combat-backend.hf.space/user/operations/{uid}",headers={
|
|
|
62 |
st.markdown('<div class="blinking-text"> CAUTION ! </div>', unsafe_allow_html=True)
|
63 |
|
64 |
with tab1:
|
|
|
65 |
|
66 |
+
|
67 |
+
option_map = {
|
68 |
+
0: ":material/pill:",
|
69 |
+
1: ":material/vaccines:",
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
selection = st.pills(
|
74 |
+
"BIOLOGICS",
|
75 |
+
options=option_map.keys(),
|
76 |
+
format_func=lambda option: option_map[option],
|
77 |
+
selection_mode="single",
|
78 |
+
)
|
79 |
+
match selection:
|
80 |
+
case 0:
|
81 |
+
st.markdown("<p style='color:white;background-color:orange'> Nanobody [CANCER targeted]</p>",unsafe_allow_html=True)
|
82 |
+
with st.form("bio",border=False):
|
83 |
+
|
84 |
+
uid=None
|
85 |
+
project_name=None
|
86 |
|
87 |
+
with st.expander("setup",icon=":material/settings:"):
|
88 |
+
uid=st.text_input("enter username")
|
89 |
+
project_name=st.text_input("enter project name ")
|
90 |
|
91 |
|
92 |
+
if not uid or not project_name:
|
93 |
+
st.markdown(":orange-badge[⚠️ Set Username and Projectname]")
|
94 |
|
95 |
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
+
bio_input = st.text_area(
|
98 |
+
"Protein Engineering Query",
|
99 |
+
placeholder="Type your query here."
|
100 |
+
)
|
101 |
+
execute_button=st.form_submit_button("execute")
|
102 |
+
|
103 |
+
if execute_button:
|
104 |
+
if uid and project_name: # Only process if fields are filled
|
105 |
+
st.session_state.projectname = project_name
|
106 |
+
st.session_state.username = uid
|
107 |
|
108 |
+
payload={
|
109 |
+
"uid":uid,
|
110 |
+
"pid":project_name,
|
111 |
+
"high_level_bio_query":bio_input
|
112 |
+
}
|
113 |
|
114 |
|
115 |
+
response=requests.post("https://thexforce-combat-backend.hf.space/bio_context_language_plan",json=payload,headers={
|
116 |
|
117 |
+
"Content-Type":"application/json",
|
118 |
+
"Authorization":f"Bearer {tok}"
|
119 |
+
})
|
120 |
|
121 |
+
plan_response=response.json()
|
122 |
+
if plan_response.get("status")=="active":
|
123 |
|
124 |
|
125 |
+
st.code(f"> operation execution successfull", language="rust")
|
126 |
+
st.success("Task completed!")
|
127 |
+
else:
|
128 |
+
st.warning(">>>Error")
|
129 |
|
130 |
+
else:
|
131 |
st.error("Please fill in both username and project name before submitting")
|
132 |
+
|
133 |
+
|
134 |
+
case 1:
|
135 |
+
st.markdown("<p style='color:white;background-color:orange'>Vaccine [Supported] </p>",unsafe_allow_html=True)
|
136 |
+
st.code("coming soon")
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
with tab2:
|
141 |
st.markdown("### newMATTER Bio Lab Operations")
|
142 |
response=requests.get(f"https://thexforce-combat-backend.hf.space/user/operations/{uid}",headers={
|