StrangerInAStrangeLand commited on
Commit
42e94cb
Β·
verified Β·
1 Parent(s): 72950a1

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. Dockerfile +7 -0
  2. README.md +40 -4
Dockerfile ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ FROM grobid/grobid:0.9.1-crf
2
+
3
+ USER root
4
+ RUN mkdir -m 777 -p /opt/grobid/grobid-home/tmp && mkdir -m 777 -p /opt/grobid/logs
5
+ WORKDIR /opt/grobid
6
+
7
+ CMD ["./grobid-service/bin/grobid-service"]
README.md CHANGED
@@ -1,10 +1,46 @@
1
  ---
2
- title: Grobid
3
- emoji: πŸ†
4
  colorFrom: purple
5
- colorTo: purple
6
  sdk: docker
 
7
  pinned: false
 
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: GROBID
3
+ emoji: πŸ“š
4
  colorFrom: purple
5
+ colorTo: green
6
  sdk: docker
7
+ app_port: 8070
8
  pinned: false
9
+ license: apache-2.0
10
+ fullWidth: true
11
+ short_description: GROBID β€” scholarly PDF to structured TEI XML
12
  ---
13
 
14
+ # GROBID on a Hugging Face Docker Space
15
+
16
+ GROBID (GeneRation Of BIbliographic Data) turns scholarly PDFs into structured **TEI XML** β€”
17
+ header (title/authors/affiliations/abstract), body full text, and parsed bibliography.
18
+
19
+ Deployed for the `psychoguineapig.com` box, which retired GROBID locally on 2026-10-09 because
20
+ the JVM was the heaviest memory consumer on the host (1.26 GiB RAM + 1.63 GiB swap) and nothing
21
+ was calling it. Here it runs on Hugging Face free CPU compute instead β€” no RAM on our box, no
22
+ GPU quota spent.
23
+
24
+ ## Image choice
25
+
26
+ `grobid/grobid:0.9.1-crf` β€” the CRF-only image, **0.51 GB** on disk. The `-full` image is
27
+ 14.8 GB and is documented as wanting a GPU for reasonable runtime; free CPU Basic Spaces have
28
+ no GPU (2 vCPU / 16 GB RAM), so CRF is the correct trade: it is the recommended image for
29
+ fulltext/RAG pre-processing.
30
+
31
+ ## Endpoints
32
+
33
+ - `https://strangerinastrangeland-grobid.hf.space/api/isalive` β€” health
34
+ - `/api/processFulltextDocument` (multipart PDF) β€” header + body + references
35
+ - `/api/processHeaderDocument` β€” metadata only (cheapest, ~2 GB RAM)
36
+ - `/api/processReferences` β€” bibliography only
37
+
38
+ Interactive console: `https://strangerinastrangeland-grobid.hf.space/`
39
+
40
+ ## Notes
41
+
42
+ - Recipe mirrors the long-standing `kermitt2/grobid` Space: vendor image, root, writable
43
+ `grobid-home/tmp`, explicit `grobid-service` CMD. ~20 GROBID Spaces exist on the Hub.
44
+ - HF Spaces cannot set `--init` / `--ulimit core=0` (which GROBID's C++ PDF parser normally
45
+ wants). If the container dies on a malformed PDF, that is the first suspect.
46
+ - Free CPU Basic Spaces sleep after 48 h idle; the next request wakes them (~30 s cold start).