Eric Mitchell commited on
Commit
db7fef9
1 Parent(s): 89e27db

Fixed page scrolling down automatically.

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -43,11 +43,15 @@ def apply_edit():
43
  def sample_model():
44
  model_outputs.loc[len(model_outputs)] = [str(test_input), "blah blah blah", len(edits)]
45
 
46
- alg_selector = st.selectbox("Editing algorithm:", EDIT_ALGS, key="alg_selector", on_change=reset)
 
 
 
 
 
47
 
48
  st.write("Edits applied so far:")
49
  st.table(edits)
50
- st.button("Reset model", on_click=reset)
51
 
52
  st.markdown("***")
53
 
@@ -55,22 +59,22 @@ col1, col2, col3 = st.columns([3, 2, 1])
55
  with col1:
56
  edit_input = st.text_input("Edit input:", placeholder="e.g., 'What is the tallest mountain on Earth?'")
57
  with col2:
58
- edit_label = st.text_input("Edit target:", placeholder="e.g., 'Denali'", help="The desired output of the model for the edit input")
59
  with col3:
60
- st.markdown("##")
61
  edit_button = st.button("Apply edit", on_click=apply_edit)
62
 
63
  st.markdown("***")
64
 
 
 
 
 
65
  col1, col2 = st.columns([5, 1])
66
  with col1:
67
- if len(edits) == 0:
68
- title = "Input to sample from *unedited* model:"
69
- else:
70
- title = f"Input to sample from *edited* model:"
71
  test_input = st.text_input(title, placeholder="e.g., 'What is the earth's tallest mountain?'")
72
  with col2:
73
- st.markdown("##")
74
  generate_button = st.button("Generate", on_click=sample_model)
75
 
76
  st.write("Model generation history:")
 
43
  def sample_model():
44
  model_outputs.loc[len(model_outputs)] = [str(test_input), "blah blah blah", len(edits)]
45
 
46
+ col1, col2 = st.columns([5,1])
47
+ with col1:
48
+ alg_selector = st.selectbox("Editing algorithm:", EDIT_ALGS, key="alg_selector", on_change=reset)
49
+ with col2:
50
+ st.text("ㅤ")
51
+ st.button("Clear edits", on_click=reset)
52
 
53
  st.write("Edits applied so far:")
54
  st.table(edits)
 
55
 
56
  st.markdown("***")
57
 
 
59
  with col1:
60
  edit_input = st.text_input("Edit input:", placeholder="e.g., 'What is the tallest mountain on Earth?'")
61
  with col2:
62
+ edit_label = st.text_input("Edit target:", placeholder="e.g., 'Denali'")
63
  with col3:
64
+ st.text("")
65
  edit_button = st.button("Apply edit", on_click=apply_edit)
66
 
67
  st.markdown("***")
68
 
69
+ if len(edits) == 0:
70
+ title = "Input to sample from *unedited* model:"
71
+ else:
72
+ title = f"Input to sample from *edited* model:"
73
  col1, col2 = st.columns([5, 1])
74
  with col1:
 
 
 
 
75
  test_input = st.text_input(title, placeholder="e.g., 'What is the earth's tallest mountain?'")
76
  with col2:
77
+ st.text("")
78
  generate_button = st.button("Generate", on_click=sample_model)
79
 
80
  st.write("Model generation history:")