Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
# Use a pipeline as a high-level helper
|
| 2 |
from transformers import pipeline
|
| 3 |
import streamlit as st
|
|
|
|
| 4 |
|
| 5 |
pipe = pipeline("table-question-answering", model="google/tapas-large-finetuned-wtq")
|
| 6 |
|
| 7 |
-
st.title('Query your data with text')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Use a pipeline as a high-level helper
|
| 2 |
from transformers import pipeline
|
| 3 |
import streamlit as st
|
| 4 |
+
import pandas as pd
|
| 5 |
|
| 6 |
pipe = pipeline("table-question-answering", model="google/tapas-large-finetuned-wtq")
|
| 7 |
|
| 8 |
+
st.title('Query your data with text')
|
| 9 |
+
file = st.file_uploader('Upload a csv file here')
|
| 10 |
+
|
| 11 |
+
if file is not None:
|
| 12 |
+
query = st.text_input('Query')
|
| 13 |
+
data = pd.read_csv(file)
|
| 14 |
+
|
| 15 |
+
st.write(pipe(table=data, query=query))
|