test_api / app.py
jonathanjordan21's picture
Update app.py
cc4b2a1 verified
raw
history blame
429 Bytes
from fastapi import FastAPI
from huggingface_hub import HfApi
app = FastAPI()
@app.get("/")
def greet_json():
with open("test.txt", "w") as f:
f.write("HELLO WORLD")
api = HfApi()
api.upload_file(
path_or_fileobj="test.txt",
path_in_repo="test.txt",
repo_id="jonathanjordan21/test-dataset",
repo_type="dataset",
)
return {"Hello": "World!"}