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

Update ui.py

Browse files
Files changed (1) hide show
  1. ui.py +24 -21
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
- else:
78
- bio_input = st.text_area(
 
 
79
  "Protein Engineering Query",
80
  placeholder="Type your query here."
81
  )
82
- execute_button=st.form_submit_button("execute")
83
 
84
- if execute_button:
85
-
86
- st.session_state.projectname =project_name
87
- st.session_state.username=uid
88
 
89
- payload={
90
- "uid":uid,
91
- "pid":project_name,
92
- "high_level_bio_query":bio_input
93
- }
94
 
95
 
96
- response=requests.post("https://thexforce-combat-backend.hf.space/bio_context_language_plan",json=payload,headers={
97
 
98
- "Content-Type":"application/json",
99
- "Authorization":f"Bearer {tok}"
100
- })
101
 
102
- plan_response=response.json()
103
- if plan_response.get("status")=="active":
104
 
105
 
106
  st.code(f"> operation execution successfull", language="rust")
107
  st.success("Task completed!")
108
- else:
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/{user_id}",headers={
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}"