jskinner215 commited on
Commit
862e59b
·
1 Parent(s): 7ba8571

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -8
app.py CHANGED
@@ -1,15 +1,30 @@
1
  from copy import deepcopy
2
  from langchain.callbacks import StreamlitCallbackHandler
3
  import streamlit as st
4
- import pandas as pd
5
- from io import StringIO
6
- from transformers import AutoTokenizer, AutoModelForTableQuestionAnswering
7
- import numpy as np
8
- import weaviate
9
- from weaviate.embedded import EmbeddedOptions
10
- from weaviate import Client
11
- from weaviate.util import generate_uuid5
12
  import logging
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  # Initialize session state attributes
15
  if "debug" not in st.session_state:
 
1
  from copy import deepcopy
2
  from langchain.callbacks import StreamlitCallbackHandler
3
  import streamlit as st
 
 
 
 
 
 
 
 
4
  import logging
5
+ from weaviate_utils import *
6
+ from tapas_utils import *
7
+ from ui_utils import *
8
+
9
+ # ...
10
+ selected_class = ui_utils.display_class_dropdown(client)
11
+ ui_utils.handle_new_class_selection(selected_class)
12
+ ui_utils.csv_upload_and_ingestion(selected_class)
13
+ ui_utils.display_query_input()
14
+ # ...
15
+
16
+ # Initialize Weaviate client
17
+ client = initialize_weaviate_client()
18
+
19
+ # Initialize TAPAS
20
+ tokenizer, model = initialize_tapas()
21
+
22
+ # UI components
23
+ display_initial_buttons()
24
+ selected_class = display_class_dropdown(client)
25
+ handle_new_class_selection()
26
+ csv_upload_and_ingestion()
27
+ display_query_input()
28
 
29
  # Initialize session state attributes
30
  if "debug" not in st.session_state: