Initial commit
This commit is contained in:
3
.gitattributes
vendored
Normal file
3
.gitattributes
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
18956
InvoiceGenerator.ipynb
Normal file
18956
InvoiceGenerator.ipynb
Normal file
File diff suppressed because it is too large
Load Diff
140
README.md
Normal file
140
README.md
Normal file
@@ -0,0 +1,140 @@
|
||||
# 🧾 VoiceBill AI – Voice-Powered Autonomous Invoice Generator
|
||||
|
||||
**VoiceBill AI** is a fully autonomous, intelligent agent that generates professional invoices directly from user voice commands. It uses state-of-the-art audio-language models like **Qwen2-Audio-7B-Instruct** to interpret voice, extract structured data using **Pydantic**, cross-check and auto-complete information from a local database, and generates polished PDF invoices using **ReportLab** — all wrapped in a clean **Gradio** UI.
|
||||
|
||||
> 🎯 Designed for freelancers, SMBs, and enterprises that need intelligent, conversational billing — fast.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Demo
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](https://colab.research.google.com/github/your-repo/VoiceBill_AI/blob/main/InvoiceGenerator.ipynb)
|
||||
|
||||
[](https://www.youtube.com/watch?v=VIDEO_ID_HERE)
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Objective
|
||||
|
||||
Enable users to **speak naturally** about invoice requirements while the AI:
|
||||
|
||||
- Understands and parses spoken content
|
||||
- Auto-fills missing fields from local memory
|
||||
- Follows up with intelligent prompts if any required field is missing
|
||||
- Builds and exports a **professional PDF invoice**
|
||||
- Works seamlessly via a user-friendly Gradio UI
|
||||
|
||||
---
|
||||
|
||||
## 🧠 System Workflow
|
||||
|
||||
1. **🎙️ Voice Input**:
|
||||
User says: _"Generate an invoice for Ramesh for 2 iPhones and 1 MacBook."_
|
||||
|
||||
2. **🧠 AI Model (Qwen2-Audio)**:
|
||||
Extracts structured data like:
|
||||
- Client: Ramesh
|
||||
- Items: iPhone, MacBook
|
||||
- Quantity: 2, 1
|
||||
|
||||
3. **📦 Local DB Checks**:
|
||||
- If Ramesh exists → fetch data
|
||||
- If item details missing → asks user
|
||||
- Stores/update user/item info in DB
|
||||
|
||||
4. **✅ Data Validation**:
|
||||
Validates structured input using **Pydantic**
|
||||
|
||||
5. **📄 Invoice Generation**:
|
||||
Generates professional PDF using **ReportLab**
|
||||
|
||||
6. **🌐 UI**:
|
||||
All happens within an intuitive Gradio interface
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Tech Stack
|
||||
|
||||
| Function | Tool / Library |
|
||||
|----------------------|--------------------------------------------|
|
||||
| Voice-to-Text | [Qwen2-Audio-7B-Instruct](https://huggingface.co/Qwen/Qwen2-Audio-7B-Instruct) |
|
||||
| Structured Validation| [Pydantic](https://docs.pydantic.dev/) |
|
||||
| Audio Processing | [Librosa](https://librosa.org/) |
|
||||
| UI Interface | [Gradio](https://www.gradio.app/) |
|
||||
| PDF Invoice Builder | [ReportLab](https://www.reportlab.com/) |
|
||||
| Runtime | Python 3.10+, Google Colab/GPU |
|
||||
|
||||
---
|
||||
|
||||
## 📦 Features
|
||||
|
||||
✅ AI-powered voice input → invoice
|
||||
✅ Auto-fill from local user/item DB
|
||||
✅ Modular, structured data validation
|
||||
✅ Dynamic follow-up on missing fields
|
||||
✅ Clean, professional invoice layout (PDF)
|
||||
✅ Gradio UI for real-time interaction
|
||||
✅ Supports 8-bit model loading (via bitsandbytes)
|
||||
|
||||
---
|
||||
|
||||
## 📁 Folder Structure
|
||||
|
||||
```python
|
||||
VoiceBill_AI/
|
||||
│
|
||||
├── InvoiceGenerator.ipynb # Main pipeline notebook
|
||||
├── requirements.txt # Install dependencies
|
||||
├── audio_inputs/ # Uploaded or recorded audio
|
||||
├── generated_invoices/ # Output PDFs saved here
|
||||
└── README.md # This file
|
||||
```
|
||||
----
|
||||
|
||||
## ⚙️ Setup
|
||||
|
||||
✅ In Colab
|
||||
|
||||
- Open notebook in Colab
|
||||
- Ensure GPU is enabled: Runtime > Change Runtime Type > GPU
|
||||
- Run all cells
|
||||
|
||||
✅ Local (Experimental)
|
||||
|
||||
```python
|
||||
$ git clone https://github.com/your-username/VoiceBill_AI.git
|
||||
$ cd VoiceBill_AI
|
||||
$ pip install -r requirements.txt
|
||||
$ python run_app.py # Optional: if converted to Python script
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🧩 Missing Data Handling (Agentic)
|
||||
|
||||
- User Info Missing? → “Who is the client?”
|
||||
- Item Info Missing? → “What’s the price for iPhone 15?”
|
||||
- GST or Address Missing? → Prompt and update DB
|
||||
- User Updates Info? → Accept and sync to local DB
|
||||
|
||||
---
|
||||
|
||||
## 📌 Future Enhancements
|
||||
|
||||
- Multi-language support via Whisper or MMS
|
||||
- Full agent framework with LangChain/Ollama integration
|
||||
- Database integration (PostgreSQL/SQLite)
|
||||
- REST API and Streamlit frontend
|
||||
- Voice-based editing of previous invoices
|
||||
|
||||
---
|
||||
|
||||
## 🙌 Credits
|
||||
|
||||
Developed by [Gyannetra Pvt Ltd ™](https://www.gyannetra.com/)
|
||||
Built to simplify billing using cutting-edge AI and local models.
|
||||
Made with 💜 and Python.
|
||||
3
audio_inputs/audio1JohnDoe.wav
Normal file
3
audio_inputs/audio1JohnDoe.wav
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aa5b5c8d032255295e669337ea489f05aedf7983f341771a1aaa208263b9a96d
|
||||
size 1365378
|
||||
3
audio_inputs/audio2SarahMilller.wav
Normal file
3
audio_inputs/audio2SarahMilller.wav
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9928126a64a326f855a37f1027d988ff958759fa78d3ca35446eb5bb3413dbdf
|
||||
size 1868118
|
||||
3
demo/InvoiceGenerator_Demo.mp4
Normal file
3
demo/InvoiceGenerator_Demo.mp4
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c8ada9f0d44fe66a86c176bdc21ec44ee303e4c2b97c486958e0526e295af3f3
|
||||
size 11218710
|
||||
3
demo/InvoiceGenerator_Demo2.mp4
Normal file
3
demo/InvoiceGenerator_Demo2.mp4
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9a479cdaf1c9949fee68de408eae99b0b7415661040c02c4ef63cc3424d58dd3
|
||||
size 6545768
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f8f1c131bed8a766c510d4d2b53208c8e981c21809a962260049e143fce93c39
|
||||
size 2969
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f42d27d1e32e07cb3f72da11ff8ce4600803f8a542f2633f93a2d050b4c6b618
|
||||
size 2867
|
||||
27
requirements.txt
Normal file
27
requirements.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
# Core libraries
|
||||
transformers @ git+https://github.com/huggingface/transformers.git
|
||||
torch>=2.0.0
|
||||
accelerate>=0.27.0
|
||||
|
||||
# Audio processing
|
||||
librosa>=0.10.1
|
||||
|
||||
# UI
|
||||
gradio>=4.19.2
|
||||
|
||||
# PDF generation
|
||||
reportlab>=4.0.8
|
||||
|
||||
# Model quantization
|
||||
bitsandbytes>=0.42.0
|
||||
|
||||
# Data validation
|
||||
pydantic>=2.5.3
|
||||
|
||||
# Utilities
|
||||
numpy>=1.26.4
|
||||
scipy>=1.13.1
|
||||
soundfile>=0.12.1
|
||||
|
||||
# Optional (for local file handling / safe JSON parsing etc.)
|
||||
typing-extensions>=4.10.0
|
||||
Reference in New Issue
Block a user