Update main.py
Browse files
main.py
CHANGED
@@ -16,10 +16,10 @@ app.add_middleware(
|
|
16 |
allow_methods=["*"],
|
17 |
allow_headers=["*"],
|
18 |
)
|
|
|
19 |
|
20 |
-
# Initialize Gradio client
|
21 |
-
|
22 |
-
client = Client("https://Makhinur/Image_Face_Upscale_Restoration-GFPGAN.hf.space/", hf_token=hf_token)
|
23 |
|
24 |
@app.post("/upload/")
|
25 |
async def upload_file(file: UploadFile = File(...), version: str = Form(...), scale: int = Form(...)):
|
|
|
16 |
allow_methods=["*"],
|
17 |
allow_headers=["*"],
|
18 |
)
|
19 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
20 |
|
21 |
+
# Initialize the Gradio client with the token
|
22 |
+
client = Client("Makhinur/Image_Face_Upscale_Restoration-GFPGAN", hf_token=HF_TOKEN)
|
|
|
23 |
|
24 |
@app.post("/upload/")
|
25 |
async def upload_file(file: UploadFile = File(...), version: str = Form(...), scale: int = Form(...)):
|