File size: 778 Bytes
10c1724
 
 
 
 
 
 
 
 
 
 
 
 
fc193de
10c1724
fc193de
 
 
10c1724
9f779c5
10c1724
 
 
 
 
 
 
 
 
 
 
6b9f5fa
10c1724
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

import boto3
import os
import re
import json
from pathlib import Path
from huggingface_hub import Repository, HfFolder
import tqdm
import subprocess

from fastapi import FastAPI
from fastapi_utils.tasks import repeat_every

from datasets import load_dataset, Image

dataset = load_dataset("beans", split="train")

dataset[0]["image"]

def get_datasetdata(dataset_path):



def sync_rooms_to_dataset():


app = FastAPI()


@app.post("/")
def read_root():
    return "Just a bot to push data to huggingface datasets "


@app.post("/sync")
def sync():
    sync_rooms_to_dataset()
    return "Synced data to huggingface datasets"


@app.on_event("startup")
@repeat_every(seconds=1800)
def repeat_sync():
    sync_rooms_to_dataset()
    return "Synced data to huggingface datasets"