Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,7 @@ from pathlib import Path
|
|
18 |
import re
|
19 |
from bs4 import BeautifulSoup
|
20 |
import mimetypes
|
|
|
21 |
|
22 |
# --- Constants ---
|
23 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
@@ -712,7 +713,8 @@ Answer with just "YES" if web search would be helpful, or "NO" if the available
|
|
712 |
download_url = f"{api_base_url}/files/{task_id}"
|
713 |
response = requests.get(download_url, timeout=30)
|
714 |
response.raise_for_status()
|
715 |
-
|
|
|
716 |
|
717 |
with open(local_file_path, 'wb') as f:
|
718 |
f.write(response.content)
|
|
|
18 |
import re
|
19 |
from bs4 import BeautifulSoup
|
20 |
import mimetypes
|
21 |
+
import tempfile
|
22 |
|
23 |
# --- Constants ---
|
24 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
|
713 |
download_url = f"{api_base_url}/files/{task_id}"
|
714 |
response = requests.get(download_url, timeout=30)
|
715 |
response.raise_for_status()
|
716 |
+
temp_dir = tempfile.mkdtemp()
|
717 |
+
local_file_path = os.path.join(temp_dir, attachment_name)
|
718 |
|
719 |
with open(local_file_path, 'wb') as f:
|
720 |
f.write(response.content)
|