Spaces:
Runtime error
Runtime error
fix: model 3 config
Browse files- .gitignore +2 -1
- app_optimized.py +2 -2
.gitignore
CHANGED
|
@@ -11,4 +11,5 @@ models/*
|
|
| 11 |
*.cpython-310.pyc
|
| 12 |
*/inference_logs/*
|
| 13 |
hf_inference_logs/*.json
|
| 14 |
-
hf_inference_logs/*
|
|
|
|
|
|
| 11 |
*.cpython-310.pyc
|
| 12 |
*/inference_logs/*
|
| 13 |
hf_inference_logs/*.json
|
| 14 |
+
hf_inference_logs/*
|
| 15 |
+
.gradio/flagged/*
|
app_optimized.py
CHANGED
|
@@ -79,7 +79,7 @@ MODEL_PATHS = {
|
|
| 79 |
CLASS_NAMES = {
|
| 80 |
"model_1": ['artificial', 'real'],
|
| 81 |
"model_2": ['AI Image', 'Real Image'],
|
| 82 |
-
"model_3": ['
|
| 83 |
"model_4": ['AI', 'Real'],
|
| 84 |
"model_5": ['Realism', 'Deepfake'],
|
| 85 |
"model_6": ['ai_gen', 'human'],
|
|
@@ -289,7 +289,7 @@ for model_key, hf_model_path in MODEL_PATHS.items():
|
|
| 289 |
if model_key == "model_5":
|
| 290 |
model_instance = pipeline("image-classification", model=hf_model_path, device=device)
|
| 291 |
preprocess_func = preprocess_resize_224
|
| 292 |
-
elif model_key in ["
|
| 293 |
current_processor = AutoFeatureExtractor.from_pretrained(hf_model_path, device=device)
|
| 294 |
model_instance = AutoModelForImageClassification.from_pretrained(hf_model_path).to(device)
|
| 295 |
|
|
|
|
| 79 |
CLASS_NAMES = {
|
| 80 |
"model_1": ['artificial', 'real'],
|
| 81 |
"model_2": ['AI Image', 'Real Image'],
|
| 82 |
+
"model_3": ['artificial', 'human'],
|
| 83 |
"model_4": ['AI', 'Real'],
|
| 84 |
"model_5": ['Realism', 'Deepfake'],
|
| 85 |
"model_6": ['ai_gen', 'human'],
|
|
|
|
| 289 |
if model_key == "model_5":
|
| 290 |
model_instance = pipeline("image-classification", model=hf_model_path, device=device)
|
| 291 |
preprocess_func = preprocess_resize_224
|
| 292 |
+
elif model_key in ["model_4"]:
|
| 293 |
current_processor = AutoFeatureExtractor.from_pretrained(hf_model_path, device=device)
|
| 294 |
model_instance = AutoModelForImageClassification.from_pretrained(hf_model_path).to(device)
|
| 295 |
|