Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,8 +14,8 @@ def text_to_json(text):
|
|
14 |
lines = text.strip().split('\n')
|
15 |
data = [{"text": line} for line in lines]
|
16 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
17 |
-
filename = f"converted/output_{timestamp}.json"
|
18 |
-
with open(filename, "
|
19 |
json.dump(data, f, indent=4)
|
20 |
return filename
|
21 |
|
|
|
14 |
lines = text.strip().split('\n')
|
15 |
data = [{"text": line} for line in lines]
|
16 |
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
|
17 |
+
filename = f"/converted/output_{timestamp}.json"
|
18 |
+
with open(filename, "a") as f:
|
19 |
json.dump(data, f, indent=4)
|
20 |
return filename
|
21 |
|