Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,16 @@
|
|
| 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, Request
|
| 2 |
+
from huggingface_hub._oauth import attach_huggingface_oauth, parse_huggingface_oauth
|
| 3 |
|
| 4 |
app = FastAPI()
|
| 5 |
|
| 6 |
@app.get("/")
|
| 7 |
def greet_json():
|
| 8 |
+
return {"Hello": "World!"}
|
| 9 |
+
|
| 10 |
+
@app.get("/me")
|
| 11 |
+
def greet_json(request: Request):
|
| 12 |
+
oauth = parse_huggingface_oauth(request)
|
| 13 |
+
print(oauth)
|
| 14 |
+
return {"Hello": print(oauth)}
|
| 15 |
+
|
| 16 |
+
attach_huggingface_oauth(app)
|