Spaces:
Sleeping
Sleeping
Commit
·
152fbf2
1
Parent(s):
60424d9
Add debug output for Tesseract
Browse files
app.py
CHANGED
|
@@ -12,6 +12,24 @@ from transformers import BlipProcessor, BlipForConditionalGeneration
|
|
| 12 |
import torch
|
| 13 |
import uvicorn
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# --------- Image Caption Model (BLIP base) -----------
|
| 16 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
| 17 |
blip_model = BlipForConditionalGeneration.from_pretrained(
|
|
|
|
| 12 |
import torch
|
| 13 |
import uvicorn
|
| 14 |
|
| 15 |
+
import shutil
|
| 16 |
+
import subprocess
|
| 17 |
+
|
| 18 |
+
try:
|
| 19 |
+
print("\n--- DEBUG INFO ---")
|
| 20 |
+
tesseract_path = shutil.which("tesseract")
|
| 21 |
+
print("Tesseract path:", tesseract_path)
|
| 22 |
+
|
| 23 |
+
if tesseract_path:
|
| 24 |
+
result = subprocess.run(["tesseract", "--version"], capture_output=True, text=True)
|
| 25 |
+
print("Tesseract version output:\n", result.stdout)
|
| 26 |
+
else:
|
| 27 |
+
print("Tesseract is NOT found in PATH")
|
| 28 |
+
print("--- END DEBUG INFO ---\n")
|
| 29 |
+
except Exception as e:
|
| 30 |
+
print("Error during Tesseract check:", e)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
# --------- Image Caption Model (BLIP base) -----------
|
| 34 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
| 35 |
blip_model = BlipForConditionalGeneration.from_pretrained(
|