hertogateis commited on
Commit
d41df51
·
verified ·
1 Parent(s): 1774fd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from transformers import pipeline
6
  # Set the page layout for Streamlit
7
  st.set_page_config(layout="wide")
8
 
9
- # Initialize TAPAS pipeline for table-based question answering
10
  tqa = pipeline(task="table-question-answering",
11
  model="google/tapas-large-finetuned-wtq",
12
  device=0) # Assuming GPU is available, otherwise set device="cpu"
@@ -24,6 +24,12 @@ st.markdown("""
24
  Upload your data and ask questions about the data to generate visualizations.
25
  """)
26
 
 
 
 
 
 
 
27
  # File uploader in the sidebar
28
  file_name = st.sidebar.file_uploader("Upload file:", type=['csv', 'xlsx'])
29
 
@@ -56,7 +62,7 @@ else:
56
  st.error(f"Error reading file: {str(e)}")
57
 
58
  # User input for the question
59
- question = st.text_input('Ask your graph-related question')
60
 
61
  with st.spinner():
62
  if st.button('Generate Graph'):
 
6
  # Set the page layout for Streamlit
7
  st.set_page_config(layout="wide")
8
 
9
+ # Initialize TAPAS pipeline for table-based question answering (multilingual)
10
  tqa = pipeline(task="table-question-answering",
11
  model="google/tapas-large-finetuned-wtq",
12
  device=0) # Assuming GPU is available, otherwise set device="cpu"
 
24
  Upload your data and ask questions about the data to generate visualizations.
25
  """)
26
 
27
+ # Language Selection
28
+ language = st.selectbox(
29
+ "Select the language of your question",
30
+ ("English", "German", "French", "Spanish", "Italian", "Others")
31
+ )
32
+
33
  # File uploader in the sidebar
34
  file_name = st.sidebar.file_uploader("Upload file:", type=['csv', 'xlsx'])
35
 
 
62
  st.error(f"Error reading file: {str(e)}")
63
 
64
  # User input for the question
65
+ question = st.text_input(f'Ask your graph-related question in {language}')
66
 
67
  with st.spinner():
68
  if st.button('Generate Graph'):