Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import pandas as pd
|
2 |
+
import torch
|
3 |
+
from io import StringIO
|
4 |
+
import streamlit as st
|
5 |
+
from app.tapas import execute_query
|
6 |
+
|
7 |
+
query = st.text_input(label='Enter your query')
|
8 |
+
st.caption('Multiple queries separated by comma(,)')
|
9 |
+
# st.write('The current movie title is', title)
|
10 |
+
uploaded_file = st.file_uploader("Choose a csv file")
|
11 |
+
|
12 |
+
if uploaded_file is not None:
|
13 |
+
dataframe = pd.read_csv(uploaded_file)
|
14 |
+
if query:
|
15 |
+
query_results = execute_query(query, dataframe)
|
16 |
+
st.markdown('**Prediction**')
|
17 |
+
for query_result in query_results:
|
18 |
+
st.markdown('_'+query_result+'_')
|
19 |
+
st.dataframe(dataframe)
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
|