Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -4,13 +4,16 @@ from fastapi.responses import FileResponse
|
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from gradio_client import Client
|
| 6 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
# Mount the static files directory
|
| 10 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 11 |
|
| 12 |
-
|
| 13 |
-
client = Client("https://ashrafb-facesw.hf.space/--replicas/j2fu5/", hf_token=hf_token)
|
| 14 |
|
| 15 |
@app.get("/")
|
| 16 |
def index():
|
|
|
|
| 4 |
from fastapi.staticfiles import StaticFiles
|
| 5 |
from gradio_client import Client
|
| 6 |
import os
|
| 7 |
+
|
| 8 |
+
hf_token = os.environ.get('HF_TOKEN')
|
| 9 |
+
client = Client("https://ashrafb-facesw.hf.space/--replicas/j2fu5/", hf_token=hf_token)
|
| 10 |
+
|
| 11 |
app = FastAPI()
|
| 12 |
|
| 13 |
# Mount the static files directory
|
| 14 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 15 |
|
| 16 |
+
|
|
|
|
| 17 |
|
| 18 |
@app.get("/")
|
| 19 |
def index():
|