José Eliel Camargo Molina commited on
Commit
dd7da0f
·
1 Parent(s): 2a71d55

added spin

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -341,14 +341,15 @@ def main():
341
  st.title("$\\mathscr{L}$agrangian Generator")
342
  st.markdown(" ### For a set of chosen fields, this model generates the corresponding Lagrangian which encodes all interactions and dynamics of the fields.")
343
 
344
- st.markdown(" #### This is a simple demo of our smaller [BART](https://arxiv.org/abs/1910.13461)-based model with 110M parameters")
345
 
346
- st.markdown(" ##### :violet[Due to computational resources, we limit the number of fields to 2 and spin = 0]")
347
- st.markdown(" ##### Choose up to two different fields:")
348
 
349
  su2_options = ["$1$", "$2$", "$3$"]
350
  su3_options = ["$1$", "$3$", "$\\bar{3}$"]
351
  u1_options = ["-1","-2/3", "-1/2", "-1/3", "0","1/3" ,"1/2", "2/3", "1"]
 
352
 
353
  # Initialize or update session state variables
354
  if 'count' not in st.session_state:
@@ -357,17 +358,17 @@ def main():
357
  st.session_state.field_strings = [] # Stores the generated field strings
358
 
359
  with st.form("field_selection"):
 
360
  su2_selection = st.radio("Select $\\mathrm{SU}(2)$ value:", su2_options)
361
  su3_selection = st.radio("Select $\\mathrm{SU}(3)$ value:", su3_options)
362
  u1_selection = st.radio("Select $\\mathrm{U}(1)$ value:", u1_options)
363
  submitted = st.form_submit_button("Add field")
364
  if submitted:
365
  if st.session_state.count < 3:
366
- sp_value = 0 # Assume SP is always 0
367
- field_string = generate_field(sp_value, su2_selection, su3_selection, u1_selection)
368
  st.session_state.field_strings.append(field_string) # Save generated field string
369
  st.session_state.count += 1 # Increment button press count
370
- elif st.session_state.count >= 2:
371
  st.write("You have reached the maximum number of fields we allow in this demo.")
372
  clear_fields = st.button("Clear fields")
373
  if clear_fields:
 
341
  st.title("$\\mathscr{L}$agrangian Generator")
342
  st.markdown(" ### For a set of chosen fields, this model generates the corresponding Lagrangian which encodes all interactions and dynamics of the fields.")
343
 
344
+ st.markdown(" #### This is a demo of our [BART](https://arxiv.org/abs/1910.13461)-based model with ca 360M parameters")
345
 
346
+ st.markdown(" ##### :violet[Due to computational resources, we limit the number of fields to 3 and the maximum length of the generated Lagrangian to 512 tokens.]")
347
+ st.markdown(" ##### Choose up to three different fields:")
348
 
349
  su2_options = ["$1$", "$2$", "$3$"]
350
  su3_options = ["$1$", "$3$", "$\\bar{3}$"]
351
  u1_options = ["-1","-2/3", "-1/2", "-1/3", "0","1/3" ,"1/2", "2/3", "1"]
352
+ spin_options = ["1", "1/2"]
353
 
354
  # Initialize or update session state variables
355
  if 'count' not in st.session_state:
 
358
  st.session_state.field_strings = [] # Stores the generated field strings
359
 
360
  with st.form("field_selection"):
361
+ spin_selection = st.radio("Select spin value:", spin_options)
362
  su2_selection = st.radio("Select $\\mathrm{SU}(2)$ value:", su2_options)
363
  su3_selection = st.radio("Select $\\mathrm{SU}(3)$ value:", su3_options)
364
  u1_selection = st.radio("Select $\\mathrm{U}(1)$ value:", u1_options)
365
  submitted = st.form_submit_button("Add field")
366
  if submitted:
367
  if st.session_state.count < 3:
368
+ field_string = generate_field(spin_selection, su2_selection, su3_selection, u1_selection)
 
369
  st.session_state.field_strings.append(field_string) # Save generated field string
370
  st.session_state.count += 1 # Increment button press count
371
+ elif st.session_state.count >= 3:
372
  st.write("You have reached the maximum number of fields we allow in this demo.")
373
  clear_fields = st.button("Clear fields")
374
  if clear_fields: