ysharma HF staff commited on
Commit
d7540cc
·
1 Parent(s): b0afc19

update api name

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -32,7 +32,8 @@ def get_next10_images(response_dict, row_count):
32
  row_count = int(row_count)
33
  #print("(1)",type(response_dict))
34
  #Convert the string to a dictionary
35
- response_dict = ast.literal_eval(response_dict)
 
36
  response = requests.post(API_URL_NEXT10, json={
37
  "data": [response_dict, row_count ] #len(initial)-1
38
  }).json()
@@ -92,6 +93,6 @@ with gr.Blocks(css = """#img_search img {width: 100%; height: 100%; object-fit:
92
  gr.HTML(value='<a href="#top">go ot top</a>', elem_id="bottom",)
93
  #image_in.change(Image_similarity_search, [image_in, search_query], [img_search], api_name="PlaygroundAI_image_search" )
94
  #search_query.submit(Image_similarity_search, [image_in, search_query], [img_search], api_name='PlaygroundAI_text_search' )
95
- b1.click(get_next10_images, [df, row_count], [df, row_count, img_search] )
96
 
97
  demo.launch(debug=True)
 
32
  row_count = int(row_count)
33
  #print("(1)",type(response_dict))
34
  #Convert the string to a dictionary
35
+ if isinstance(response_dict, dict) == False :
36
+ response_dict = ast.literal_eval(response_dict)
37
  response = requests.post(API_URL_NEXT10, json={
38
  "data": [response_dict, row_count ] #len(initial)-1
39
  }).json()
 
93
  gr.HTML(value='<a href="#top">go ot top</a>', elem_id="bottom",)
94
  #image_in.change(Image_similarity_search, [image_in, search_query], [img_search], api_name="PlaygroundAI_image_search" )
95
  #search_query.submit(Image_similarity_search, [image_in, search_query], [img_search], api_name='PlaygroundAI_text_search' )
96
+ b1.click(get_next10_images, [df, row_count], [df, row_count, img_search], api_name = "load_playgroundai_images" )
97
 
98
  demo.launch(debug=True)