cbg342 commited on
Commit
fffe233
1 Parent(s): e5021b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import re, os, subprocess, openai, random, regex, shutil, requests
2
  import pandas as pd
3
  import numpy as np
4
  import streamlit as st
@@ -9,6 +9,15 @@ thispath = os.path.realpath(os.path.dirname(__file__))
9
  if 'displayChat' not in st.session_state:
10
  with st.spinner('Setting up plugins...'):
11
  os.system('mkdir files')
 
 
 
 
 
 
 
 
 
12
  os.system('mkdir plugins')
13
  googleS = requests.get('https://raw.githubusercontent.com/d3n7/GPT-4-Unlimited-Tools/main/plugins/google.py').content
14
  googlePath = os.path.join(thispath, 'plugins', 'google.py')
 
1
+ import re, os, subprocess, openai, random, regex, shutil, requests, datetime
2
  import pandas as pd
3
  import numpy as np
4
  import streamlit as st
 
9
  if 'displayChat' not in st.session_state:
10
  with st.spinner('Setting up plugins...'):
11
  os.system('mkdir files')
12
+ thishour = str(datetime.datetime.now().hour)
13
+ if os.path.isfile(os.join(thispath, 'timestamp.txt')):
14
+ with open(os.join(thispath, 'timestamp.txt')) as f:
15
+ stampHour = f.readline().strip('\n')
16
+ if thishour != stampHour:
17
+ os.system('rm -rf files/*')
18
+ os.system('echo '+thishour+' > timestamp.txt')
19
+ else:
20
+ os.system('echo '+thishour+' > timestamp.txt')
21
  os.system('mkdir plugins')
22
  googleS = requests.get('https://raw.githubusercontent.com/d3n7/GPT-4-Unlimited-Tools/main/plugins/google.py').content
23
  googlePath = os.path.join(thispath, 'plugins', 'google.py')