Spaces:
Running
Running
Update ui.py
Browse files
ui.py
CHANGED
@@ -74,44 +74,47 @@ def APP():
|
|
74 |
|
75 |
if not uid or not project_name:
|
76 |
st.markdown(":orange-badge[⚠️ Set Username and Projectname]")
|
77 |
-
|
78 |
-
|
|
|
|
|
79 |
"Protein Engineering Query",
|
80 |
placeholder="Type your query here."
|
81 |
)
|
82 |
-
|
83 |
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
|
95 |
|
96 |
-
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
|
102 |
-
|
103 |
-
|
104 |
|
105 |
|
106 |
st.code(f"> operation execution successfull", language="rust")
|
107 |
st.success("Task completed!")
|
108 |
-
|
109 |
st.warning(">>>Error")
|
110 |
|
111 |
-
|
|
|
112 |
with tab2:
|
113 |
st.markdown("### newMATTER Bio Lab Operations")
|
114 |
-
response=requests.get(f"https://thexforce-combat-backend.hf.space/user/operations/{
|
115 |
|
116 |
"Content-Type":"application/json",
|
117 |
"Authorization":f"Bearer {tok}"
|
|
|
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={
|
118 |
|
119 |
"Content-Type":"application/json",
|
120 |
"Authorization":f"Bearer {tok}"
|