File size: 2,578 Bytes
f97e4c3
 
e68d857
 
 
 
 
f97e4c3
 
e68d857
f97e4c3
e68d857
 
f97e4c3
e68d857
f97e4c3
 
 
 
e68d857
 
f97e4c3
e68d857
 
 
 
 
f97e4c3
e68d857
 
74d4944
f97e4c3
e68d857
f97e4c3
 
 
 
e68d857
 
 
 
 
 
 
 
 
 
 
 
f97e4c3
 
e68d857
 
 
 
 
f97e4c3
e68d857
f97e4c3
 
e68d857
 
 
 
f97e4c3
 
e68d857
 
 
f97e4c3
e68d857
f97e4c3
e68d857
f97e4c3
e68d857
 
 
f97e4c3
e68d857
f97e4c3
e68d857
 
f97e4c3
e68d857
 
 
 
 
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
library_name: transformers
tags:
- llama
- invoice-extraction
- sft
- gguf
---

# Llama-base-3.1-8B-invoice-gguf-sft

A fine-tuned Llama-3.1-8B model optimized for **invoice understanding and extraction**.  
This version is exported in **GGUF** format for performant inference with tools such as **llama.cpp**, **Ollama**, and **text-generation-ui**.

---

## Model Details

### Model Description
This model adapts Llama-3.1-8B for structured invoice field extraction.  
The goal is to support tasks such as reading invoice text and identifying key fields (amount, date, vendor, tax, line items, etc.).

- **Developed by:** *muhammed-afsal-p-m*
- **Model type:** Auto-regressive language model (decoder-only)
- **Languages:** English (primary) — Other languages not verified
- **License:** *Fill in — e.g., MIT, Apache-2.0, others*
- **Fine-tuned from:** Llama-3.1-8B (Meta)

### Model Sources
- **Repository:** https://huggingface.co/muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft


---

## Uses

### Direct Use
Useful for:
- Invoice text understanding  
- Extracting structured fields  
- Document parsing prototypes  
- Local inference via GGUF

### Downstream Use
Can be integrated into:
- RPA invoice pipelines  
- Accounting automation  
- OCR → LLM extraction stages  
- Document indexing/search systems

### Out-of-Scope Use
Not suited for:
- Legal/financial decision-making without human review  
- High-stakes extraction requiring guaranteed accuracy  
- Multi-language invoice parsing (not validated)  
- Vision-based tasks (requires text extracted separately)

---

## Bias, Risks, and Limitations
- Model accuracy depends heavily on the **quality and consistency** of invoice text.  
- May hallucinate missing fields instead of explicitly stating absence.  
- Invoices vary widely in structure; unseen formats may reduce reliability.  
- Any training biases (invoice styles, languages, domain distribution) affect output.

### Recommendations
- Always verify extracted results.  
- Use deterministic decoding when consistent outputs are required.  
- Validate outputs with rule-based post-processing.

---

## How to Get Started

```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_name = "muhammed-afsal-p-m/Llama-base-3.1-8B-invoice-gguf-sft"

# For GGUF, use llama.cpp / ctransformers:
from ctransformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    model_file="model.gguf",  # replace with your file name
)
print(model("Extract invoice total from: ..."))