Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,23 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
|
3 |
app = FastAPI()
|
4 |
|
5 |
@app.get("/")
|
6 |
def greet_json():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
return {"Hello": "World!"}
|
|
|
1 |
from fastapi import FastAPI
|
2 |
+
from huggingface_hub import HfApi
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
@app.get("/")
|
7 |
def greet_json():
|
8 |
+
with open("test.txt", "w") as f:
|
9 |
+
f.write("HELLO WORLD")
|
10 |
+
api = HfApi()
|
11 |
+
|
12 |
+
api.upload_file(
|
13 |
+
|
14 |
+
path_or_fileobj="test.txt",
|
15 |
+
|
16 |
+
path_in_repo="test.txt",
|
17 |
+
|
18 |
+
repo_id="jonathanjordan21/test-dataset",
|
19 |
+
|
20 |
+
repo_type="dataset",
|
21 |
+
|
22 |
+
)
|
23 |
return {"Hello": "World!"}
|