Spaces:
Runtime error
Runtime error
pi194046
commited on
Commit
·
c4b90e4
1
Parent(s):
d8e6a19
adding logs
Browse files
app.py
CHANGED
@@ -140,13 +140,16 @@ with tab2:
|
|
140 |
# Mock payload for processing the URL
|
141 |
payload = {"url": presentation_url, "id": uuid_from_js}
|
142 |
response = requests.post(f"{BASE_URL}/presentation_creator", json=payload, headers=headers)
|
143 |
-
|
144 |
if response.status_code == 200:
|
145 |
st.info("Processing started. Please wait...")
|
146 |
unique_id=response.json()["filename"]
|
147 |
# Poll for completion
|
|
|
148 |
while True:
|
149 |
status_response = requests.get(f"{BASE_URL}/status/{unique_id}", headers=headers)
|
|
|
|
|
150 |
if status_response.status_code == 200 and (status_response.json()["status"] == "complete" or status_response.json()["status"] == "error"):
|
151 |
if status_response.json()["status"] == "complete":
|
152 |
st.success("Presentation created successfully.")
|
@@ -159,6 +162,8 @@ with tab2:
|
|
159 |
file_name=f"presentation_{unique_id}.pptx",
|
160 |
mime="application/pdf"
|
161 |
)
|
|
|
|
|
162 |
break
|
163 |
time.sleep(10)
|
164 |
else:
|
|
|
140 |
# Mock payload for processing the URL
|
141 |
payload = {"url": presentation_url, "id": uuid_from_js}
|
142 |
response = requests.post(f"{BASE_URL}/presentation_creator", json=payload, headers=headers)
|
143 |
+
print("response",response)
|
144 |
if response.status_code == 200:
|
145 |
st.info("Processing started. Please wait...")
|
146 |
unique_id=response.json()["filename"]
|
147 |
# Poll for completion
|
148 |
+
print("unique id is ",unique_id,BASE_URL)
|
149 |
while True:
|
150 |
status_response = requests.get(f"{BASE_URL}/status/{unique_id}", headers=headers)
|
151 |
+
|
152 |
+
print("status_response",status_response)
|
153 |
if status_response.status_code == 200 and (status_response.json()["status"] == "complete" or status_response.json()["status"] == "error"):
|
154 |
if status_response.json()["status"] == "complete":
|
155 |
st.success("Presentation created successfully.")
|
|
|
162 |
file_name=f"presentation_{unique_id}.pptx",
|
163 |
mime="application/pdf"
|
164 |
)
|
165 |
+
else:
|
166 |
+
st.error("error in creating presentation")
|
167 |
break
|
168 |
time.sleep(10)
|
169 |
else:
|