piyushgrover commited on
Commit
ed35f08
·
1 Parent(s): 3351157

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -111,12 +111,16 @@ def search_by_text_and_photo(query_text, query_photo=None, query_photo_id=None,
111
  best_photo_ids = find_best_matches(search_features, photo_features, photo_ids, 10)
112
  else:
113
  # Display the results
114
- print("Test search result")
115
  best_photo_ids = search_unslash(model, query_text, photo_features, photo_ids, 10)
116
 
117
  return best_photo_ids
118
 
119
 
 
 
 
 
120
  with gr.Blocks() as app:
121
  with gr.Row():
122
  gr.Markdown(
@@ -128,7 +132,7 @@ with gr.Blocks() as app:
128
  with gr.Row(visible=True):
129
  with gr.Column():
130
  with gr.Row():
131
- search_text = gr.Textbox(value='', placeholder='Search..', label='Enter search query')
132
 
133
  with gr.Row():
134
  submit_btn = gr.Button("Submit", variant='primary')
@@ -217,7 +221,8 @@ with gr.Blocks() as app:
217
  '''
218
  Launch the app
219
  '''
220
- app.launch()
 
221
 
222
 
223
 
 
111
  best_photo_ids = find_best_matches(search_features, photo_features, photo_ids, 10)
112
  else:
113
  # Display the results
114
+ print("Result...")
115
  best_photo_ids = search_unslash(model, query_text, photo_features, photo_ids, 10)
116
 
117
  return best_photo_ids
118
 
119
 
120
+ def fn_query_on_load():
121
+ return "Dogs playing during sunset"
122
+
123
+
124
  with gr.Blocks() as app:
125
  with gr.Row():
126
  gr.Markdown(
 
132
  with gr.Row(visible=True):
133
  with gr.Column():
134
  with gr.Row():
135
+ search_text = gr.Textbox(value=fn_query_on_load, placeholder='Search..', label=None)
136
 
137
  with gr.Row():
138
  submit_btn = gr.Button("Submit", variant='primary')
 
221
  '''
222
  Launch the app
223
  '''
224
+ app.launch(share=True)
225
+
226
 
227
 
228