Spaces:
Sleeping
Sleeping
Akshatha Arodi
commited on
Commit
·
caa8f34
1
Parent(s):
eaf38ad
Update time
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ from huggingface_hub import HfApi
|
|
12 |
from transformers import CLIPTokenizer, AutoImageProcessor, AutoModelForImageClassification
|
13 |
from safetensors.torch import load_file as safe_load
|
14 |
import subprocess
|
15 |
-
import datetime
|
16 |
|
17 |
# --- Config ---
|
18 |
HUB_REPO_ID = "CDL-AMLRT/OpenArenaLeaderboard"
|
@@ -159,7 +159,7 @@ def detect_with_model(image: Image.Image, prompt: str, username: str, model_name
|
|
159 |
|
160 |
csv_path = os.path.join("test", "leaderboard_entries.csv")
|
161 |
header = "file_name,prompt,label,model,split,user,timestamp\n"
|
162 |
-
csv_line = f"test/fake/{image_filename},\"{prompt}\",fake,{model_name},test,{username},{datetime.
|
163 |
try:
|
164 |
file_exists = os.path.exists(csv_path)
|
165 |
with open(csv_path, "a", encoding="utf-8") as f:
|
|
|
12 |
from transformers import CLIPTokenizer, AutoImageProcessor, AutoModelForImageClassification
|
13 |
from safetensors.torch import load_file as safe_load
|
14 |
import subprocess
|
15 |
+
from datetime import datetime
|
16 |
|
17 |
# --- Config ---
|
18 |
HUB_REPO_ID = "CDL-AMLRT/OpenArenaLeaderboard"
|
|
|
159 |
|
160 |
csv_path = os.path.join("test", "leaderboard_entries.csv")
|
161 |
header = "file_name,prompt,label,model,split,user,timestamp\n"
|
162 |
+
csv_line = f"test/fake/{image_filename},\"{prompt}\",fake,{model_name},test,{username},{datetime.now().isoformat()}\n"
|
163 |
try:
|
164 |
file_exists = os.path.exists(csv_path)
|
165 |
with open(csv_path, "a", encoding="utf-8") as f:
|