Spaces:
Runtime error
Runtime error
jaifar530
commited on
try to fix
Browse files
app.py
CHANGED
|
@@ -46,19 +46,7 @@ options = ["AI vs AI - RandomForest - 88 Samples", "AI vs AI - Ridge - 2000 Samp
|
|
| 46 |
selected_option = st.selectbox('Select an Option', options)
|
| 47 |
|
| 48 |
|
| 49 |
-
# Check if the file exists
|
| 50 |
-
if not os.path.isfile('AI_vs_AI_RandomForest_88_Samples.pkl'):
|
| 51 |
-
# Download the zip file if it doesn't exist
|
| 52 |
-
url = 'https://jaifar.net/AI_vs_AI_RandomForest_88_Samples.pkl'
|
| 53 |
-
headers = {
|
| 54 |
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
|
| 55 |
-
}
|
| 56 |
|
| 57 |
-
response = requests.get(url, headers=headers)
|
| 58 |
-
|
| 59 |
-
# Save the file
|
| 60 |
-
with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'wb') as file1:
|
| 61 |
-
file1.write(response.content)
|
| 62 |
|
| 63 |
|
| 64 |
# Check if the file exists
|
|
@@ -209,6 +197,20 @@ def add_vectorized_features(df):
|
|
| 209 |
# Function define AI_vs_AI_RandomForest_88_Samples
|
| 210 |
def AI_vs_AI_RandomForest_88_Samples(df):
|
| 211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
# At this point, the pickle file should exist, either it was already there, or it has been downloaded and extracted.
|
| 213 |
with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'rb') as file1:
|
| 214 |
clf_loaded = pickle.load(file1)
|
|
|
|
| 46 |
selected_option = st.selectbox('Select an Option', options)
|
| 47 |
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
# Check if the file exists
|
|
|
|
| 197 |
# Function define AI_vs_AI_RandomForest_88_Samples
|
| 198 |
def AI_vs_AI_RandomForest_88_Samples(df):
|
| 199 |
|
| 200 |
+
# Check if the file exists
|
| 201 |
+
if not os.path.isfile('AI_vs_AI_RandomForest_88_Samples.pkl'):
|
| 202 |
+
# Download the zip file if it doesn't exist
|
| 203 |
+
url = 'https://jaifar.net/AI_vs_AI_RandomForest_88_Samples.pkl'
|
| 204 |
+
headers = {
|
| 205 |
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
|
| 206 |
+
}
|
| 207 |
+
|
| 208 |
+
response = requests.get(url, headers=headers)
|
| 209 |
+
|
| 210 |
+
# Save the file
|
| 211 |
+
with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'wb') as file1:
|
| 212 |
+
file1.write(response.content)
|
| 213 |
+
|
| 214 |
# At this point, the pickle file should exist, either it was already there, or it has been downloaded and extracted.
|
| 215 |
with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'rb') as file1:
|
| 216 |
clf_loaded = pickle.load(file1)
|