Omnibus commited on
Commit
4958740
·
1 Parent(s): e42a430

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -22,10 +22,17 @@ def query2(fetch_url):
22
  API_URL2 = f"https://datasets-server.huggingface.co/rows?dataset={fetch_url}&config=TEST&split=test&offset=150&length=10"
23
 
24
  response = requests.get(API_URL2)
25
- return response.json()
 
 
 
 
 
26
 
27
  def find_fn(inp,out_json):
 
28
  print (inp)
 
29
  return(f'{out_json}[{inp}]')
30
  with gr.Blocks() as app:
31
  with gr.Row():
 
22
  API_URL2 = f"https://datasets-server.huggingface.co/rows?dataset={fetch_url}&config=TEST&split=test&offset=150&length=10"
23
 
24
  response = requests.get(API_URL2)
25
+ #json_object = json.dumps(dictionary, indent=4)
26
+ json_object=response.json()
27
+ # Writing to sample.json
28
+ with open("sample.json", "w") as outfile:
29
+ outfile.write(json_object)
30
+ return "sample.json"
31
 
32
  def find_fn(inp,out_json):
33
+ print(out_json[1])
34
  print (inp)
35
+
36
  return(f'{out_json}[{inp}]')
37
  with gr.Blocks() as app:
38
  with gr.Row():