Thanh Vinh Vo
commited on
Commit
·
63bf5e9
1
Parent(s):
abcce25
update
Browse files
app.py
CHANGED
|
@@ -141,9 +141,6 @@ def get_file(question_id: str, file_name: str) -> str:
|
|
| 141 |
print(f"Fetching text file from URL: {url}")
|
| 142 |
|
| 143 |
# Create downloads directory if it doesn't exist
|
| 144 |
-
downloads_dir = "downloaded_texts"
|
| 145 |
-
os.makedirs(downloads_dir, exist_ok=True)
|
| 146 |
-
|
| 147 |
response = None
|
| 148 |
try:
|
| 149 |
response = requests.get(url, timeout=30)
|
|
@@ -159,7 +156,7 @@ def get_file(question_id: str, file_name: str) -> str:
|
|
| 159 |
print(f"Response content length: {len(response.content)} bytes")
|
| 160 |
|
| 161 |
# Use original filename directly
|
| 162 |
-
local_path =
|
| 163 |
|
| 164 |
# Save the text file locally
|
| 165 |
with open(local_path, 'wb') as f:
|
|
|
|
| 141 |
print(f"Fetching text file from URL: {url}")
|
| 142 |
|
| 143 |
# Create downloads directory if it doesn't exist
|
|
|
|
|
|
|
|
|
|
| 144 |
response = None
|
| 145 |
try:
|
| 146 |
response = requests.get(url, timeout=30)
|
|
|
|
| 156 |
print(f"Response content length: {len(response.content)} bytes")
|
| 157 |
|
| 158 |
# Use original filename directly
|
| 159 |
+
local_path = file_name
|
| 160 |
|
| 161 |
# Save the text file locally
|
| 162 |
with open(local_path, 'wb') as f:
|