File size: 744 Bytes
2e1a095
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
param(
    [string]$Python = "py -3.10"
)

$ErrorActionPreference = "Stop"
$root = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
$venv = Join-Path $root ".venv-arabic-glm-ocr"

if (-not (Test-Path $venv)) {
    Invoke-Expression "$Python -m venv `"$venv`""
}

$pythonExe = Join-Path $venv "Scripts\python.exe"
& $pythonExe -m pip install --upgrade pip
& $pythonExe -m pip install -r (Join-Path $root "requirements-arabic-glm-ocr.txt")
& $pythonExe -c "import torch; from transformers import AutoModelForImageTextToText, AutoProcessor"

Write-Host "Arabic-GLM-OCR sidecar is ready at $venv"
Write-Host "Default model: sherif1313/Arabic-GLM-OCR-v2"
Write-Host "Use OCR_ENGINE=arabic-glm-ocr for short samples or a worker."