OneOCR Dev
commited on
Commit
·
2d0dbfe
1
Parent(s):
feff106
fix: install Wine Staging (supports bcrypt CFB mode) - fixes CreateOcrPipeline error 6
Browse files- test_wine_colab.ipynb +27 -6
test_wine_colab.ipynb
CHANGED
|
@@ -9,8 +9,10 @@
|
|
| 9 |
"\n",
|
| 10 |
"Test czy `oneocr.dll` działa na Linuxie przez Wine.\n",
|
| 11 |
"\n",
|
|
|
|
|
|
|
| 12 |
"**Kroki:**\n",
|
| 13 |
-
"1. Instalacja Wine + MinGW\n",
|
| 14 |
"2. Clone repo + upload DLL\n",
|
| 15 |
"3. Diagnostyka Wine (debug loader)\n",
|
| 16 |
"4. Test OCR przez Wine\n",
|
|
@@ -28,13 +30,32 @@
|
|
| 28 |
"metadata": {},
|
| 29 |
"outputs": [],
|
| 30 |
"source": [
|
| 31 |
-
"# 1. Install Wine + MinGW\n",
|
| 32 |
-
"
|
| 33 |
-
"
|
| 34 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
"!wine64 --version\n",
|
| 36 |
"!x86_64-w64-mingw32-gcc --version 2>&1 | head -1\n",
|
| 37 |
-
"print(\"
|
| 38 |
]
|
| 39 |
},
|
| 40 |
{
|
|
|
|
| 9 |
"\n",
|
| 10 |
"Test czy `oneocr.dll` działa na Linuxie przez Wine.\n",
|
| 11 |
"\n",
|
| 12 |
+
"**Problem znaleziony:** Ubuntu stock Wine nie wspiera `bcrypt AES-256-CFB` mode (potrzebne do deszyfrowania modelu). Rozwiązanie: instalujemy **Wine Staging** który ma pełne wsparcie bcrypt.\n",
|
| 13 |
+
"\n",
|
| 14 |
"**Kroki:**\n",
|
| 15 |
+
"1. Instalacja Wine Staging + MinGW\n",
|
| 16 |
"2. Clone repo + upload DLL\n",
|
| 17 |
"3. Diagnostyka Wine (debug loader)\n",
|
| 18 |
"4. Test OCR przez Wine\n",
|
|
|
|
| 30 |
"metadata": {},
|
| 31 |
"outputs": [],
|
| 32 |
"source": [
|
| 33 |
+
"# 1. Install Wine STAGING + MinGW\n",
|
| 34 |
+
"# Ubuntu stock wine64 nie wspiera bcrypt CFB mode - instalujemy Wine Staging\n",
|
| 35 |
+
"import subprocess, os\n",
|
| 36 |
+
"\n",
|
| 37 |
+
"print(\"Installing Wine Staging (supports bcrypt CFB mode)...\")\n",
|
| 38 |
+
"cmds = [\n",
|
| 39 |
+
" 'dpkg --add-architecture i386',\n",
|
| 40 |
+
" 'apt-get update -qq',\n",
|
| 41 |
+
" 'apt-get install -y software-properties-common',\n",
|
| 42 |
+
" 'mkdir -pm755 /etc/apt/keyrings',\n",
|
| 43 |
+
" 'wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key',\n",
|
| 44 |
+
" 'wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources',\n",
|
| 45 |
+
" 'apt-get update -qq',\n",
|
| 46 |
+
" 'apt-get install -y --install-recommends winehq-staging mingw-w64',\n",
|
| 47 |
+
"]\n",
|
| 48 |
+
"\n",
|
| 49 |
+
"for cmd in cmds:\n",
|
| 50 |
+
" r = subprocess.run(cmd, shell=True, capture_output=True, text=True)\n",
|
| 51 |
+
" if r.returncode != 0 and 'wget' not in cmd: # wget errors are OK (file exists)\n",
|
| 52 |
+
" print(f\"ERROR: {cmd}\")\n",
|
| 53 |
+
" print(r.stderr[:200])\n",
|
| 54 |
+
"\n",
|
| 55 |
+
"# Verify\n",
|
| 56 |
"!wine64 --version\n",
|
| 57 |
"!x86_64-w64-mingw32-gcc --version 2>&1 | head -1\n",
|
| 58 |
+
"print(\"\\nOK - Wine Staging installed\")"
|
| 59 |
]
|
| 60 |
},
|
| 61 |
{
|