File size: 1,054 Bytes
29a03ec
42632ea
2c7042c
 
 
29a03ec
2c7042c
29a03ec
 
 
 
42632ea
3da4f0d
42632ea
 
 
3da4f0d
42632ea
 
3da4f0d
42632ea
 
 
 
 
2c7042c
42632ea
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
title: OpScan.IA  DeepSeek-OCR + R1 Medical Mini (GGUF rápido)
emoji: 🩺
colorFrom: gray
colorTo: purple
sdk: gradio
sdk_version: 5.49.1
app_file: app.py
pinned: false
---

# OpScan.IA — DeepSeek-OCR + DeepSeek-R1 Medical Mini (GGUF local rápido)

**Objetivo:** máxima velocidad **sin tokens** en Spaces Zero/CPU.  
El chat usa **DeepSeek-R1 Medical Mini** en **GGUF** (cuantizado Q4 si está disponible) con `llama.cpp`.  
El OCR se hace con **DeepSeek-OCR** (con *fallback* automático a `_attn_implementation="eager"` si no hay FlashAttention2).

## Requisitos
Ver `requirements.txt`.

## Variables opcionales
- `GGUF_REPO` (default: `mradermacher/DeepSeek-r1-Medical-Mini-GGUF`)
- `GGUF_FILE` (si no se define, el app prueba en orden: `Q4_K_M`, `Q4_0`, `Q5_0`, `Q8_0`, `f16`)
- `N_CTX` (2048), `N_THREADS` (auto), `N_GPU_LAYERS` (0), `N_BATCH` (96), `WARMUP` (0/1)
- `OCR_ATTN_IMPL`: `flash_attention_2` o `eager`

## Ejecución local
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python app.py