Omnibus commited on
Commit
60ed47f
1 Parent(s): 4958740

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  import requests
 
3
  from datasets import load_dataset
4
 
5
  #dataset = load_dataset("nlphuji/flickr30k", split="test[10:20]")
@@ -22,8 +23,8 @@ 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
- #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)
 
1
  import gradio as gr
2
  import requests
3
+ import json
4
  from datasets import load_dataset
5
 
6
  #dataset = load_dataset("nlphuji/flickr30k", split="test[10:20]")
 
23
  API_URL2 = f"https://datasets-server.huggingface.co/rows?dataset={fetch_url}&config=TEST&split=test&offset=150&length=10"
24
 
25
  response = requests.get(API_URL2)
26
+ dictionary=response.json()
27
+ json_object = json.dumps(dictionary, indent=4)
28
  # Writing to sample.json
29
  with open("sample.json", "w") as outfile:
30
  outfile.write(json_object)