Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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')
|