Spaces:
Runtime error
Runtime error
Terry Zhuo
commited on
Commit
·
6a92f83
1
Parent(s):
8ca0a55
update
Browse files- azure_count_ip_data.py +3 -5
azure_count_ip_data.py
CHANGED
|
@@ -161,7 +161,8 @@ def get_file_data(content: str) -> Tuple[Optional[str], Optional[str], bool]:
|
|
| 161 |
try:
|
| 162 |
lines = [line.strip() for line in content.split('\n') if line.strip()]
|
| 163 |
user_prompt = json.loads(lines[0])["state"]["messages"][0][1]
|
| 164 |
-
|
|
|
|
| 165 |
if not lines:
|
| 166 |
return None, None, False, user_prompt
|
| 167 |
|
|
@@ -268,10 +269,7 @@ def count_files_per_annotator(reader: 'RemoteLogReader', start_date_str: str = "
|
|
| 268 |
# Get annotator name from either IP or username
|
| 269 |
annotator_name = get_annotator_name(ip, username)
|
| 270 |
if annotator_name and user_prompt not in EXAMPLES:
|
| 271 |
-
|
| 272 |
-
name_prompts[annotator_name].add(user_prompt.lower())
|
| 273 |
-
except Exception as e:
|
| 274 |
-
log.error(user_prompt)
|
| 275 |
|
| 276 |
except Exception as e:
|
| 277 |
log.error(f"Error processing logs for date {date_str}: {e}")
|
|
|
|
| 161 |
try:
|
| 162 |
lines = [line.strip() for line in content.split('\n') if line.strip()]
|
| 163 |
user_prompt = json.loads(lines[0])["state"]["messages"][0][1]
|
| 164 |
+
if isinstance(user_prompt, list):
|
| 165 |
+
user_prompt = user_prompt[0]
|
| 166 |
if not lines:
|
| 167 |
return None, None, False, user_prompt
|
| 168 |
|
|
|
|
| 269 |
# Get annotator name from either IP or username
|
| 270 |
annotator_name = get_annotator_name(ip, username)
|
| 271 |
if annotator_name and user_prompt not in EXAMPLES:
|
| 272 |
+
name_prompts[annotator_name].add(user_prompt.lower())
|
|
|
|
|
|
|
|
|
|
| 273 |
|
| 274 |
except Exception as e:
|
| 275 |
log.error(f"Error processing logs for date {date_str}: {e}")
|