Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -15,7 +15,15 @@ hf_token = os.environ.get('HF_TOKEN')
|
|
| 15 |
client = Client("https://ashrafb-image-to-sketch.hf.space/", hf_token=hf_token)
|
| 16 |
|
| 17 |
import tempfile
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
import base64
|
|
|
|
| 15 |
client = Client("https://ashrafb-image-to-sketch.hf.space/", hf_token=hf_token)
|
| 16 |
|
| 17 |
import tempfile
|
| 18 |
+
from fastapi.middleware.cors import CORSMiddleware
|
| 19 |
+
|
| 20 |
+
app.add_middleware(
|
| 21 |
+
CORSMiddleware,
|
| 22 |
+
allow_origins=["*"], # Adjust as needed, '*' allows requests from any origin
|
| 23 |
+
allow_credentials=True,
|
| 24 |
+
allow_methods=["*"],
|
| 25 |
+
allow_headers=["*"],
|
| 26 |
+
)
|
| 27 |
|
| 28 |
|
| 29 |
import base64
|