areneau commited on
Commit
2c161be
·
verified ·
1 Parent(s): 524fd9d

Clarify base model and System One extraction usage

Browse files
Files changed (2) hide show
  1. README.md +3 -8
  2. clairic_model.py +4 -4
README.md CHANGED
@@ -1,6 +1,7 @@
1
  ---
2
  license: apache-2.0
3
  library_name: transformers
 
4
  pipeline_tag: image-text-to-text
5
  tags:
6
  - clairic
@@ -24,6 +25,7 @@ in the Clairic family.
24
 
25
  ## Model
26
 
 
27
  - **Inputs:** a text or JSON state, optional images, and a mapping of field names to specifications.
28
  - **Outputs:** typed values, lists, nulls, estimates, and forecast paths.
29
  - **Scoring:** extraction confidence and null probabilities, plus optional quantiles for estimates.
@@ -35,15 +37,8 @@ Use Python 3.11 or later and install the packages listed in `requirements.txt`.
35
  Transformers; `xgrammar` supplies schema constraints through a Transformers logits
36
  processor.
37
 
38
- The supported GPU setup is Linux x86_64 with an H100 or H200, PyTorch 2.13.0
39
- with CUDA 13.0, and Transformers 5.10.2. The CUDA BF16 default uses FlashAttention 3
40
- for text and vision, with batches of up to 32 sequences. The first load fetches
41
- the pinned attention kernel through `kernels`; cache it before running offline.
42
- Explicit `attn_implementation`, `batch_size`, and `text_batch_size` loader options
43
- remain available.
44
-
45
  Download the repository, load the model and processor, and call `systemone` with a
46
- System One: Predict request.
47
 
48
  ```python
49
  import sys
 
1
  ---
2
  license: apache-2.0
3
  library_name: transformers
4
+ base_model: Qwen/Qwen3.8-27B
5
  pipeline_tag: image-text-to-text
6
  tags:
7
  - clairic
 
25
 
26
  ## Model
27
 
28
+ - **Base model:** [Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B).
29
  - **Inputs:** a text or JSON state, optional images, and a mapping of field names to specifications.
30
  - **Outputs:** typed values, lists, nulls, estimates, and forecast paths.
31
  - **Scoring:** extraction confidence and null probabilities, plus optional quantiles for estimates.
 
37
  Transformers; `xgrammar` supplies schema constraints through a Transformers logits
38
  processor.
39
 
 
 
 
 
 
 
 
40
  Download the repository, load the model and processor, and call `systemone` with a
41
+ System One: Extract request.
42
 
43
  ```python
44
  import sys
clairic_model.py CHANGED
@@ -1,4 +1,4 @@
1
- """Clairic's Transformers loader and System One prediction interface."""
2
 
3
  from __future__ import annotations
4
 
@@ -41,7 +41,7 @@ def _request(value: Mapping[str, Any] | PredictRequest) -> PredictRequest:
41
 
42
 
43
  class ClairicModel:
44
- """A model and its typed prediction head, with synchronous and async APIs."""
45
 
46
  def __init__(self, runtime: ClairicFlashModel, public_name: str) -> None:
47
  self.runtime = runtime
@@ -65,7 +65,7 @@ class ClairicModel:
65
  return serialize_response(validated, output, self.model_id)
66
 
67
  def predict(self, request: Mapping[str, Any] | PredictRequest) -> dict[str, Any]:
68
- """Return structured values and scores for a prediction request."""
69
  try:
70
  asyncio.get_running_loop()
71
  except RuntimeError:
@@ -121,7 +121,7 @@ def systemone(
121
  request: Mapping[str, Any] | PredictRequest,
122
  max_length: int | None = None,
123
  ) -> dict[str, Any]:
124
- """Answer a System One prediction request with typed fields and confidence."""
125
  if processor is not model.processor:
126
  raise ValueError("Use the processor returned with this model")
127
  if max_length is not None and max_length != model.runtime.settings.max_length:
 
1
+ """Clairic's Transformers loader and System One extraction interface."""
2
 
3
  from __future__ import annotations
4
 
 
41
 
42
 
43
  class ClairicModel:
44
+ """A model and its typed extraction head, with synchronous and async APIs."""
45
 
46
  def __init__(self, runtime: ClairicFlashModel, public_name: str) -> None:
47
  self.runtime = runtime
 
65
  return serialize_response(validated, output, self.model_id)
66
 
67
  def predict(self, request: Mapping[str, Any] | PredictRequest) -> dict[str, Any]:
68
+ """Return structured values and scores for a System One: Extract request."""
69
  try:
70
  asyncio.get_running_loop()
71
  except RuntimeError:
 
121
  request: Mapping[str, Any] | PredictRequest,
122
  max_length: int | None = None,
123
  ) -> dict[str, Any]:
124
+ """Answer a System One: Extract request with typed fields and confidence."""
125
  if processor is not model.processor:
126
  raise ValueError("Use the processor returned with this model")
127
  if max_length is not None and max_length != model.runtime.settings.max_length: