Spaces:
Configuration error
Configuration error
Bajagain, Ujjwal
commited on
Commit
·
ab6404c
1
Parent(s):
a3d5e39
Remove large model files for Hugging Face Spaces compatibility
Browse files- .gitignore +2 -3
- app.py +6 -1
.gitignore
CHANGED
@@ -284,6 +284,5 @@ unsloth_compiled_cache/
|
|
284 |
# Allow requirements.txt
|
285 |
!requirements.txt
|
286 |
|
287 |
-
#
|
288 |
-
|
289 |
-
!gemma-3n_pois_med_plants/**
|
|
|
284 |
# Allow requirements.txt
|
285 |
!requirements.txt
|
286 |
|
287 |
+
# Ignore local model directory (too large for git)
|
288 |
+
gemma-3n_pois_med_plants/
|
|
app.py
CHANGED
@@ -60,8 +60,10 @@ def load_model():
|
|
60 |
adapter_path = "./gemma-3n_pois_med_plants"
|
61 |
if os.path.exists(adapter_path):
|
62 |
model.load_adapter(adapter_path)
|
|
|
63 |
else:
|
64 |
-
print(f"Warning:
|
|
|
65 |
|
66 |
# Enable inference mode with compilation disabled
|
67 |
FastVisionModel.for_inference(model)
|
@@ -366,6 +368,9 @@ with gr.Blocks(css=custom_css, title="GemmaYaatri - Vision AI Assistant", theme=
|
|
366 |
<p><strong>Base Model:</strong> Gemma-3n-E2B-it (Unsloth optimized)</p>
|
367 |
<p><strong>Specialization:</strong> Plant and insect identification</p>
|
368 |
<p><strong>Features:</strong> Fine-tuned for detailed biological image analysis</p>
|
|
|
|
|
|
|
369 |
</div>
|
370 |
</div>
|
371 |
""")
|
|
|
60 |
adapter_path = "./gemma-3n_pois_med_plants"
|
61 |
if os.path.exists(adapter_path):
|
62 |
model.load_adapter(adapter_path)
|
63 |
+
print("Local adapter loaded successfully!")
|
64 |
else:
|
65 |
+
print(f"Warning: Local model path {adapter_path} not found.")
|
66 |
+
print("Running with base model only. For full functionality, please provide the model files.")
|
67 |
|
68 |
# Enable inference mode with compilation disabled
|
69 |
FastVisionModel.for_inference(model)
|
|
|
368 |
<p><strong>Base Model:</strong> Gemma-3n-E2B-it (Unsloth optimized)</p>
|
369 |
<p><strong>Specialization:</strong> Plant and insect identification</p>
|
370 |
<p><strong>Features:</strong> Fine-tuned for detailed biological image analysis</p>
|
371 |
+
<p style="color: #F57F17; font-style: italic; margin-top: 10px;">
|
372 |
+
<strong>Note:</strong> Currently running with base model. For enhanced accuracy, local adapter files are recommended.
|
373 |
+
</p>
|
374 |
</div>
|
375 |
</div>
|
376 |
""")
|