Chris4K commited on
Commit
f626a38
·
verified ·
1 Parent(s): d6fbd23

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -14,7 +14,6 @@ from app_agent_config import AgentConfig
14
  # Create an instance of AgentConfig
15
  agent_config = AgentConfig()
16
 
17
- global image
18
 
19
  # Declare global variable
20
 
@@ -40,30 +39,30 @@ with st.sidebar:
40
  if img_file_buffer is not None:
41
  image_raw = Image.open(img_file_buffer)
42
  #global image
43
- image = np.array(image_raw)
44
  ########
45
- st.image(image)
46
 
47
  uploaded_file = st.file_uploader("Choose a file", type='pdf')
48
  if uploaded_file is not None:
49
  # To read file as bytes:
50
  pdf_document = uploaded_file.getvalue()
51
  global document
52
- document = pdf_document
53
  st.write(pdf_document)
54
 
55
  uploaded_txt_file = st.file_uploader("Choose a file", type='txt')
56
  if uploaded_txt_file is not None:
57
  # To read file as bytes:
58
  txt_document = uploaded_txt_file.getvalue()
59
- document = txt_document
60
  st.write(txt_document)
61
 
62
  uploaded_csv_file = st.file_uploader("Choose a file", type='csv')
63
  if uploaded_csv_file is not None:
64
  # To read file as bytes:
65
  csv_document = uploaded_csv_file.getvalue()
66
- document = csv_document
67
  st.write(csv_document)
68
 
69
  # To convert to a string based IO:
 
14
  # Create an instance of AgentConfig
15
  agent_config = AgentConfig()
16
 
 
17
 
18
  # Declare global variable
19
 
 
39
  if img_file_buffer is not None:
40
  image_raw = Image.open(img_file_buffer)
41
  #global image
42
+ agent_config.image = np.array(image_raw)
43
  ########
44
+ st.image(agent_config.image)
45
 
46
  uploaded_file = st.file_uploader("Choose a file", type='pdf')
47
  if uploaded_file is not None:
48
  # To read file as bytes:
49
  pdf_document = uploaded_file.getvalue()
50
  global document
51
+ agent_config.document = pdf_document
52
  st.write(pdf_document)
53
 
54
  uploaded_txt_file = st.file_uploader("Choose a file", type='txt')
55
  if uploaded_txt_file is not None:
56
  # To read file as bytes:
57
  txt_document = uploaded_txt_file.getvalue()
58
+ agent_config.document = txt_document
59
  st.write(txt_document)
60
 
61
  uploaded_csv_file = st.file_uploader("Choose a file", type='csv')
62
  if uploaded_csv_file is not None:
63
  # To read file as bytes:
64
  csv_document = uploaded_csv_file.getvalue()
65
+ agent_config.document = csv_document
66
  st.write(csv_document)
67
 
68
  # To convert to a string based IO: