Junaidb commited on
Commit
1bd1714
·
verified ·
1 Parent(s): d0ae7ed

Update ui.py

Browse files
Files changed (1) hide show
  1. ui.py +59 -34
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
- uid=None
68
- project_name=None
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
 
70
- with st.expander("setup",icon=":material/settings:"):
71
- uid=st.text_input("enter username")
72
- project_name=st.text_input("enter project name ")
73
 
74
 
75
- if not uid or not project_name:
76
- st.markdown(":orange-badge[⚠️ Set Username and Projectname]")
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
- if execute_button:
87
- if uid and project_name: # Only process if fields are filled
88
- st.session_state.projectname = project_name
89
- st.session_state.username = uid
 
 
 
 
 
 
90
 
91
- payload={
92
- "uid":uid,
93
- "pid":project_name,
94
- "high_level_bio_query":bio_input
95
- }
96
 
97
 
98
- response=requests.post("https://thexforce-combat-backend.hf.space/bio_context_language_plan",json=payload,headers={
99
 
100
- "Content-Type":"application/json",
101
- "Authorization":f"Bearer {tok}"
102
- })
103
 
104
- plan_response=response.json()
105
- if plan_response.get("status")=="active":
106
 
107
 
108
- st.code(f"> operation execution successfull", language="rust")
109
- st.success("Task completed!")
110
- else:
111
- st.warning(">>>Error")
112
 
113
- else:
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={