Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -4,11 +4,32 @@ from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
4 |
import torch
|
5 |
import sqlite3
|
6 |
import json
|
7 |
-
from db_setup import setup_database
|
8 |
#setup database
|
9 |
-
setup_database()
|
10 |
conn = sqlite3.connect('sfdc_la.db')
|
11 |
cursor = conn.cursor()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
"""
|
13 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
14 |
"""
|
|
|
4 |
import torch
|
5 |
import sqlite3
|
6 |
import json
|
|
|
7 |
#setup database
|
|
|
8 |
conn = sqlite3.connect('sfdc_la.db')
|
9 |
cursor = conn.cursor()
|
10 |
+
cursor.execute('''
|
11 |
+
CREATE TABLE IF NOT EXISTS sfdc_la (
|
12 |
+
LAid TEXT PRIMARY KEY,
|
13 |
+
Amount REAL,
|
14 |
+
Tenure INTEGER,
|
15 |
+
ROI REAL,
|
16 |
+
Stage VARCHAR
|
17 |
+
)
|
18 |
+
''')
|
19 |
+
#inserting data into table
|
20 |
+
loan_data = [
|
21 |
+
('LA00001', 10000, 12, 5.5, 'Customer Onboarding'),
|
22 |
+
('LA00002', 15000, 24, 6.0, 'Credit Review'),
|
23 |
+
('LA00003', 20000, 36, 6.5, 'Loan Disbursal'),
|
24 |
+
('LA23455', 25000, 48, 7.0, 'OTC Clearance'),
|
25 |
+
('LA00005', 30000, 60, 7.5, 'Customer Onboarding')
|
26 |
+
]
|
27 |
+
cursor.executemany('''
|
28 |
+
INSERT INTO sfdc_la (LAid, Amount, Tenure, ROI, Stage)
|
29 |
+
VALUES (?, ?, ?, ?, ?)
|
30 |
+
''', loan_data)
|
31 |
+
conn.commit()
|
32 |
+
conn.close()
|
33 |
"""
|
34 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
35 |
"""
|