Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ 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"
|
18 |
with open(filename, "a") as f:
|
19 |
json.dump(data, f, indent=4)
|
20 |
return filename
|
@@ -41,7 +41,7 @@ def generate_and_upload(text):
|
|
41 |
repo_id = "katsukiai/DeepFocus-X3"
|
42 |
upload_info = api.upload_file(
|
43 |
path_or_fileobj=json_file,
|
44 |
-
path_in_repo=os.path.basename(json_file),
|
45 |
repo_id=repo_id,
|
46 |
repo_type="dataset",
|
47 |
token=token
|
|
|
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"output_{timestamp}.json"
|
18 |
with open(filename, "a") as f:
|
19 |
json.dump(data, f, indent=4)
|
20 |
return filename
|
|
|
41 |
repo_id = "katsukiai/DeepFocus-X3"
|
42 |
upload_info = api.upload_file(
|
43 |
path_or_fileobj=json_file,
|
44 |
+
path_in_repo="convert/"+os.path.basename(json_file),
|
45 |
repo_id=repo_id,
|
46 |
repo_type="dataset",
|
47 |
token=token
|