Chris4K commited on
Commit
8f2a15c
·
verified ·
1 Parent(s): c4d62aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -34,6 +34,12 @@ import pandas as pd
34
  from io import StringIO
35
  with st.sidebar:
36
  with st.expander("Set content and context"):
 
 
 
 
 
 
37
  img_file_buffer = st.file_uploader('Upload a PNG image', type='png')
38
 
39
  if img_file_buffer is not None:
@@ -46,8 +52,7 @@ with st.sidebar:
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
 
@@ -76,7 +81,8 @@ with st.sidebar:
76
  # Can be used wherever a "file-like" object is accepted:
77
  dataframe = pd.read_csv(uploaded_file)
78
  st.write(dataframe)
79
-
 
80
 
81
 
82
  # Create a page with tabs
 
34
  from io import StringIO
35
  with st.sidebar:
36
  with st.expander("Set content and context"):
37
+
38
+ agent_config.image = st.camera_input("Take a picture")
39
+
40
+ agent_config.context = st.text_area("Text to translate")
41
+
42
+
43
  img_file_buffer = st.file_uploader('Upload a PNG image', type='png')
44
 
45
  if img_file_buffer is not None:
 
52
  uploaded_file = st.file_uploader("Choose a file", type='pdf')
53
  if uploaded_file is not None:
54
  # To read file as bytes:
55
+ pdf_document = uploaded_file.getvalue()
 
56
  agent_config.document = pdf_document
57
  st.write(pdf_document)
58
 
 
81
  # Can be used wherever a "file-like" object is accepted:
82
  dataframe = pd.read_csv(uploaded_file)
83
  st.write(dataframe)
84
+
85
+ agent_config.configure()
86
 
87
 
88
  # Create a page with tabs