Spaces:
Running
Running
Update ui.py
Browse files
ui.py
CHANGED
@@ -89,8 +89,7 @@ def APP():
|
|
89 |
project_name=st.text_input("enter project name ")
|
90 |
target=st.text_input("Set up the target antigen ")
|
91 |
|
92 |
-
|
93 |
-
st.markdown(":orange-badge[⚠️ Set Projectname and Target Antigen before proceeding]")
|
94 |
|
95 |
|
96 |
bio_input = st.text_area(
|
@@ -100,34 +99,38 @@ def APP():
|
|
100 |
execute_button=st.form_submit_button("execute")
|
101 |
|
102 |
if execute_button:
|
103 |
-
|
104 |
-
|
105 |
-
st.session_state.
|
106 |
-
|
107 |
-
|
108 |
-
"
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
|
|
|
|
|
|
|
|
113 |
|
114 |
|
115 |
-
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
|
121 |
-
|
122 |
-
|
123 |
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
|
129 |
-
|
130 |
-
|
131 |
|
132 |
|
133 |
if selection == 1:
|
|
|
89 |
project_name=st.text_input("enter project name ")
|
90 |
target=st.text_input("Set up the target antigen ")
|
91 |
|
92 |
+
|
|
|
93 |
|
94 |
|
95 |
bio_input = st.text_area(
|
|
|
99 |
execute_button=st.form_submit_button("execute")
|
100 |
|
101 |
if execute_button:
|
102 |
+
|
103 |
+
|
104 |
+
##st.session_state.projectname = project_name
|
105 |
+
#st.session_state.username = uid
|
106 |
+
if not project_name or not target:
|
107 |
+
st.markdown(":orange-badge[⚠️ Set Projectname and Target Antigen before proceeding]")
|
108 |
+
else:
|
109 |
+
|
110 |
+
payload={
|
111 |
+
"uid":st.user.email ,
|
112 |
+
"pid":project_name,
|
113 |
+
"target":target,
|
114 |
+
"high_level_bio_query":bio_input
|
115 |
+
}
|
116 |
|
117 |
|
118 |
+
response=requests.post("https://thexforce-combat-backend.hf.space/bio_context_language_plan",json=payload,headers={
|
119 |
|
120 |
+
"Content-Type":"application/json",
|
121 |
+
"Authorization":f"Bearer {tok}"
|
122 |
+
})
|
123 |
|
124 |
+
plan_response=response.json()
|
125 |
+
if plan_response.get("status")=="active":
|
126 |
|
127 |
|
128 |
+
st.markdown(f"## {plan_response.get('plan')}")
|
129 |
+
else:
|
130 |
+
st.warning(">>>Error")
|
131 |
|
132 |
+
else:
|
133 |
+
st.error("Please fill in both username and project name before submitting")
|
134 |
|
135 |
|
136 |
if selection == 1:
|