awacke1 commited on
Commit
416ed00
·
1 Parent(s): 66bad60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -19,7 +19,7 @@ from audio_recorder_streamlit import audio_recorder
19
  openai.api_key = os.getenv('OPENAI_KEY')
20
  st.set_page_config(page_title="GPT Streamlit Document Reasoner",layout="wide")
21
 
22
- menu = ["htm", "txt", "md", "py"]
23
  choice = st.sidebar.selectbox("Output File Type:", menu)
24
  model_choice = st.sidebar.radio("Select Model:", ('gpt-3.5-turbo', 'gpt-3.5-turbo-0301'))
25
 
@@ -91,6 +91,12 @@ def get_table_download_link(file_path):
91
  ext = os.path.splitext(file_name)[1] # get the file extension
92
  if ext == '.txt':
93
  mime_type = 'text/plain'
 
 
 
 
 
 
94
  elif ext == '.htm':
95
  mime_type = 'text/html'
96
  elif ext == '.md':
@@ -152,7 +158,7 @@ def main():
152
  #max_length = 12000 - optimal for gpt35 turbo. 2x=24000 for gpt4. 8x=96000 for gpt4-32k.
153
  max_length = st.slider("File section length for large files", min_value=1000, max_value=128000, value=12000, step=1000)
154
  with colupload:
155
- uploaded_file = st.file_uploader("Add a file for context:", type=["xml", "json", "html", "htm", "md", "txt"])
156
 
157
  document_sections = deque()
158
  document_responses = {}
 
19
  openai.api_key = os.getenv('OPENAI_KEY')
20
  st.set_page_config(page_title="GPT Streamlit Document Reasoner",layout="wide")
21
 
22
+ menu = ["htm", "txt", "xlsx", "csv", "md", "py"] #619
23
  choice = st.sidebar.selectbox("Output File Type:", menu)
24
  model_choice = st.sidebar.radio("Select Model:", ('gpt-3.5-turbo', 'gpt-3.5-turbo-0301'))
25
 
 
91
  ext = os.path.splitext(file_name)[1] # get the file extension
92
  if ext == '.txt':
93
  mime_type = 'text/plain'
94
+ elif ext == '.py':
95
+ mime_type = 'text/plain'
96
+ elif ext == '.xlsx':
97
+ mime_type = 'text/plain'
98
+ elif ext == '.csv':
99
+ mime_type = 'text/plain'
100
  elif ext == '.htm':
101
  mime_type = 'text/html'
102
  elif ext == '.md':
 
158
  #max_length = 12000 - optimal for gpt35 turbo. 2x=24000 for gpt4. 8x=96000 for gpt4-32k.
159
  max_length = st.slider("File section length for large files", min_value=1000, max_value=128000, value=12000, step=1000)
160
  with colupload:
161
+ uploaded_file = st.file_uploader("Add a file for context:", type=["xml", "json", "xlsx","csv","html", "htm", "md", "txt"])
162
 
163
  document_sections = deque()
164
  document_responses = {}