Spaces:
Sleeping
Sleeping
Commit
·
94d2fd1
1
Parent(s):
4f59000
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ import numpy as np
|
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
translator = pipeline(model= "saikiranmaddukuri/chat_to_sql0.17", max_new_tokens= 100)
|
|
|
|
| 8 |
|
| 9 |
## Function to read SQL data
|
| 10 |
def read_sql_query(sql, db):
|
|
@@ -20,6 +21,9 @@ def read_sql_query(sql, db):
|
|
| 20 |
# Streamlit app
|
| 21 |
def main():
|
| 22 |
st.title("Conversational AI: Text-2-SQL")
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
|
| 25 |
create_table_statement= "CREATE TABLE car_sales (Manufacturer text, Model text, Sales_in_thousands float, __year_resale_value float, Vehicle_type text, Price_in_thousands float, Engine_size float, Horsepower float, Wheelbase float, Width float, Length float, Curb_weight float, Fuel_capacity float, Fuel_efficiency float, Latest_Launch text, Power_perf_factor float)"
|
|
|
|
| 5 |
import pandas as pd
|
| 6 |
|
| 7 |
translator = pipeline(model= "saikiranmaddukuri/chat_to_sql0.17", max_new_tokens= 100)
|
| 8 |
+
df= pd.read_csv("Car_sales.csv")
|
| 9 |
|
| 10 |
## Function to read SQL data
|
| 11 |
def read_sql_query(sql, db):
|
|
|
|
| 21 |
# Streamlit app
|
| 22 |
def main():
|
| 23 |
st.title("Conversational AI: Text-2-SQL")
|
| 24 |
+
|
| 25 |
+
column_df = pd.DataFrame(column_info.items(), columns=['Column Name', 'Data Type'])
|
| 26 |
+
st.sidebar.table(column_df)
|
| 27 |
|
| 28 |
|
| 29 |
create_table_statement= "CREATE TABLE car_sales (Manufacturer text, Model text, Sales_in_thousands float, __year_resale_value float, Vehicle_type text, Price_in_thousands float, Engine_size float, Horsepower float, Wheelbase float, Width float, Length float, Curb_weight float, Fuel_capacity float, Fuel_efficiency float, Latest_Launch text, Power_perf_factor float)"
|