Spaces:
Sleeping
Sleeping
Commit
·
f4af3c4
1
Parent(s):
d210108
Add system
Browse files
app.py
CHANGED
@@ -183,10 +183,7 @@ def run_model():
|
|
183 |
with open(default_log_path, "w") as f:
|
184 |
f.write(json.dumps(log_entry, indent=1))
|
185 |
|
186 |
-
default_tsv_path = f"{FEEDBACK_DIR}/augmented_{timestamp}_{user_id}.tsv"
|
187 |
tsv_path = outputs["sorted_events"]
|
188 |
-
df = pd.read_excel(tsv_path)
|
189 |
-
df.to_csv(default_tsv_path, sep='\t', index=False)
|
190 |
|
191 |
try:
|
192 |
api = HfApi()
|
@@ -197,6 +194,13 @@ def run_model():
|
|
197 |
repo_type="dataset",
|
198 |
token=HF_TOKEN
|
199 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
|
201 |
|
202 |
except Exception as e:
|
|
|
183 |
with open(default_log_path, "w") as f:
|
184 |
f.write(json.dumps(log_entry, indent=1))
|
185 |
|
|
|
186 |
tsv_path = outputs["sorted_events"]
|
|
|
|
|
187 |
|
188 |
try:
|
189 |
api = HfApi()
|
|
|
194 |
repo_type="dataset",
|
195 |
token=HF_TOKEN
|
196 |
)
|
197 |
+
api.upload_file(
|
198 |
+
path_or_fileobj=tsv_path,
|
199 |
+
path_in_repo=f"logs/augmented_{timestamp}_{user_id}.tsv",
|
200 |
+
repo_id=HF_DATASET_REPO,
|
201 |
+
repo_type="dataset",
|
202 |
+
token=HF_TOKEN
|
203 |
+
)
|
204 |
|
205 |
|
206 |
except Exception as e:
|