Spaces:
Runtime error
Runtime error
theFisher86
commited on
Commit
•
daef7a0
1
Parent(s):
36d894e
Update app.py
Browse files
app.py
CHANGED
@@ -19,14 +19,14 @@ def faceSwap(file1, file2):
|
|
19 |
"accept": "application/json",
|
20 |
"content-type": "application/json"
|
21 |
}
|
22 |
-
|
23 |
response = requests.post(url, json=payload, headers=headers)
|
24 |
|
25 |
if response.status_code == 200:
|
26 |
jobNumber = response.json().get("job")
|
27 |
print(f"Job created with ID: {jobNumber}")
|
28 |
urlBase = f"https://api.prodia.com/v1/job/{jobNumber}"
|
29 |
-
headers = {"accept": "application/json", "X-Prodia-Key": api_key
|
30 |
response = requests.get(urlBase + jobNumber, headers=headers)
|
31 |
result = print(response)
|
32 |
else:
|
|
|
19 |
"accept": "application/json",
|
20 |
"content-type": "application/json"
|
21 |
}
|
22 |
+
api_key=os.getenv("PRODIA_API_KEY")
|
23 |
response = requests.post(url, json=payload, headers=headers)
|
24 |
|
25 |
if response.status_code == 200:
|
26 |
jobNumber = response.json().get("job")
|
27 |
print(f"Job created with ID: {jobNumber}")
|
28 |
urlBase = f"https://api.prodia.com/v1/job/{jobNumber}"
|
29 |
+
headers = {"accept": "application/json", "X-Prodia-Key": api_key}
|
30 |
response = requests.get(urlBase + jobNumber, headers=headers)
|
31 |
result = print(response)
|
32 |
else:
|