File size: 1,886 Bytes
b0157c8
fd54039
df3b954
 
 
 
 
 
 
 
b0157c8
 
df3b954
b0157c8
df3b954
b0157c8
df3b954
b0157c8
df3b954
 
 
 
 
b0157c8
df3b954
237389c
 
 
 
b0157c8
237389c
 
 
 
 
 
 
b0157c8
df3b954
 
 
 
 
 
 
 
 
 
 
 
 
b0157c8
df3b954
 
 
 
 
b0157c8
df3b954
b0157c8
df3b954
 
 
 
 
 
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
---
license: apache-2.0
tags:
  - finance
  - tax
  - banking
  - investment
  - indian-finance
  - gst
  - conversational
---

# 🏦 Finxan

Finxan is an AI assistant specialized in Indian finance β€” GST, tax compliance, B2B invoicing, banking, and investments.

## πŸ’¬ What Finxan can do

- 🧾 Calculate GST and verify tax compliance
- 🏦 Create and manage B2B invoices
- πŸ“ˆ Answer investment and banking queries
- βœ… Check financial document compliance
- πŸ€– Answer questions about itself

## πŸš€ Quick Start
```python
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

base = AutoModelForCausalLM.from_pretrained(
    "mistralai/Mistral-7B-v0.1",
    torch_dtype=torch.float16,
    device_map="auto"
)
model = PeftModel.from_pretrained(base, "webdpro/finxan")
tokenizer = AutoTokenizer.from_pretrained("webdpro/finxan")

def ask_finxan(instruction, input_text=""):
    prompt = f"### Instruction:\n{instruction}\n\n### Input:\n{input_text}\n\n### Response:\n"
    inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
    outputs = model.generate(
        **inputs,
        max_new_tokens=80,
        temperature=0.3,
        do_sample=True,
        repetition_penalty=1.3,
        pad_token_id=tokenizer.eos_token_id
    )
    full = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return full.split("### Response:")[-1].strip()

# Try it
print(ask_finxan("What is your name?"))
print(ask_finxan("Calculate GST", "Invoice Rs 50000, GST 18%"))
print(ask_finxan("Who built you?"))
```

## πŸ“Œ Example Outputs

| Question | Answer |
|----------|--------|
| What is your name? | I am Finxan, your AI finance assistant |
| Calculate GST for Rs 50000 at 18% | GST: Rs 9000. Total: Rs 59000 |
| Create a B2B invoice | Invoice created with GST applied |
| Check GST compliance | GST valid. Compliant. |