gchhablani commited on
Commit
95fff6e
1 Parent(s): 8187482

Update apps

Browse files
Files changed (2) hide show
  1. apps/mlm.py +3 -3
  2. apps/vqa.py +3 -3
apps/mlm.py CHANGED
@@ -67,8 +67,8 @@ def app(state):
67
  with st.spinner("Loading model..."):
68
  mlm_state.mlm_model = load_model(mlm_checkpoints[0])
69
 
70
-
71
- if st.button(
72
  "Get a random example",
73
  help="Get a random example from the 100 `seeded` image-text pairs.",
74
  ):
@@ -93,7 +93,7 @@ def app(state):
93
  "Enter a URL to an image",
94
  value="http://images.cocodataset.org/val2017/000000039769.jpg",
95
  )
96
- if st.button("Use this URL"):
97
  image_data = requests.get(query1, stream=True).raw
98
  image = np.asarray(Image.open(image_data))
99
  mlm_state.mlm_image = image
 
67
  with st.spinner("Loading model..."):
68
  mlm_state.mlm_model = load_model(mlm_checkpoints[0])
69
 
70
+ col1, col2 = st.beta_columns([1,1])
71
+ if col1.button(
72
  "Get a random example",
73
  help="Get a random example from the 100 `seeded` image-text pairs.",
74
  ):
 
93
  "Enter a URL to an image",
94
  value="http://images.cocodataset.org/val2017/000000039769.jpg",
95
  )
96
+ if col2.button("Use above URL"):
97
  image_data = requests.get(query1, stream=True).raw
98
  image = np.asarray(Image.open(image_data))
99
  mlm_state.mlm_image = image
apps/vqa.py CHANGED
@@ -77,8 +77,8 @@ def app(state):
77
 
78
  # Display Top-5 Predictions
79
 
80
-
81
- if st.button(
82
  "Get a random example",
83
  help="Get a random example from the 100 `seeded` image-text pairs.",
84
  ):
@@ -99,7 +99,7 @@ def app(state):
99
  "Enter a URL to an image",
100
  value="http://images.cocodataset.org/val2017/000000039769.jpg",
101
  )
102
- if st.button("Use this URL"):
103
  image_data = requests.get(query1, stream=True).raw
104
  image = np.asarray(Image.open(image_data))
105
  vqa_state.mlm_image = image
 
77
 
78
  # Display Top-5 Predictions
79
 
80
+ col1, col2 = st.beta_columns([1,1])
81
+ if col1.button(
82
  "Get a random example",
83
  help="Get a random example from the 100 `seeded` image-text pairs.",
84
  ):
 
99
  "Enter a URL to an image",
100
  value="http://images.cocodataset.org/val2017/000000039769.jpg",
101
  )
102
+ if col2.button("Use above URL"):
103
  image_data = requests.get(query1, stream=True).raw
104
  image = np.asarray(Image.open(image_data))
105
  vqa_state.mlm_image = image