Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import requests
|
2 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
3 |
+
API_URL1 = "https://datasets-server.huggingface.co/splits?dataset=nlphuji/flickr30k""
|
4 |
+
def query1():
|
5 |
+
response = requests.get(API_URL1, headers=headers)
|
6 |
+
return response.json()
|
7 |
+
data = query1()
|
8 |
+
print (data)
|
9 |
+
|
10 |
+
|
11 |
+
API_URL2 = "https://datasets-server.huggingface.co/rows?dataset=nlphuji/flickr30k&config=default&split=train&offset=150&length=10"
|
12 |
+
def query2():
|
13 |
+
response = requests.get(API_URL2)
|
14 |
+
return response.json()
|
15 |
+
data = query2()
|
16 |
+
|
17 |
+
pirnt (data)
|