File size: 423 Bytes
a5c227b
 
 
7e30e03
a5c227b
 
 
7e30e03
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Use a pipeline as a high-level helper
from transformers import pipeline
import streamlit as st
import pandas as pd

pipe = pipeline("table-question-answering", model="google/tapas-large-finetuned-wtq")

st.title('Query your data with text')
file = st.file_uploader('Upload a csv file here')

if file is not None:
    query = st.text_input('Query')
    data = pd.read_csv(file)

    st.write(pipe(table=data, query=query))