rakeshkumar1812 commited on
Commit
bbaa777
·
verified ·
1 Parent(s): 2bdf728

Upload 6 files

Browse files

new code manual table loaded

Files changed (3) hide show
  1. app.py +2 -4
  2. custom_table.py +0 -0
  3. database.py +4 -2
app.py CHANGED
@@ -6,7 +6,7 @@ import os
6
  import sqlite3
7
  import google.generativeai as genai
8
  import pandas as pd
9
- from database import df
10
  from utils import remove_triple_quotes
11
 
12
  # configure genai key
@@ -75,6 +75,7 @@ submit=st.button("Ask the Question :")
75
 
76
 
77
  # Display DataFrame in Streamlit
 
78
  st.write('##### This is the sample table...')
79
  st.write(df.head(5))
80
 
@@ -97,6 +98,3 @@ if submit:
97
 
98
  # st.write(row)
99
 
100
-
101
-
102
-
 
6
  import sqlite3
7
  import google.generativeai as genai
8
  import pandas as pd
9
+ from custom_table import get_dataframe
10
  from utils import remove_triple_quotes
11
 
12
  # configure genai key
 
75
 
76
 
77
  # Display DataFrame in Streamlit
78
+ df = get_dataframe()
79
  st.write('##### This is the sample table...')
80
  st.write(df.head(5))
81
 
 
98
 
99
  # st.write(row)
100
 
 
 
 
custom_table.py ADDED
The diff for this file is too large to render. See raw diff
 
database.py CHANGED
@@ -1,12 +1,14 @@
1
  import pandas as pd
2
  import sqlite3
 
3
 
4
  # Specify the path to your Excel file
5
  # excel_file_path = 'C:\\Users\\rakes\\sql\\table_data.xlsx'
6
- excel_file_path = "https://huggingface.co/spaces/rakeshkumar1812/text-to-SQL-GenAI-App/tree/main/table_data.xlsx"
7
 
8
  # Read the Excel file into a pandas DataFrame
9
- df = pd.read_excel(excel_file_path, sheet_name='Customer_Data')
 
10
 
11
  # Display the DataFrame
12
  # print(df.shape)
 
1
  import pandas as pd
2
  import sqlite3
3
+ from custom_table import get_dataframe
4
 
5
  # Specify the path to your Excel file
6
  # excel_file_path = 'C:\\Users\\rakes\\sql\\table_data.xlsx'
7
+ # excel_file_path = "https://huggingface.co/spaces/rakeshkumar1812/text-to-SQL-GenAI-App/tree/main/table_data.xlsx"
8
 
9
  # Read the Excel file into a pandas DataFrame
10
+ # df = pd.read_excel(excel_file_path, sheet_name='Customer_Data')
11
+ df = get_dataframe()
12
 
13
  # Display the DataFrame
14
  # print(df.shape)