Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,19 @@ import time # Run update_embeddings.py periodically
|
|
3 |
import threading # in a separate thread
|
4 |
import gradio as gr # Create a Gradio interface so spaces doesnt timeout
|
5 |
from datetime import datetime
|
|
|
6 |
|
7 |
def log_message(message):
|
8 |
# Print message with a timestamp
|
9 |
print(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - {message}")
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Function to run update_embeddings.py periodically
|
12 |
def run_script_periodically():
|
13 |
|
@@ -33,6 +41,8 @@ def run_script_periodically():
|
|
33 |
else:
|
34 |
|
35 |
print("Today is not Monday, lets check again in some.")
|
|
|
|
|
36 |
|
37 |
# Wait a bit
|
38 |
time.sleep(60 * 60 * 1)
|
|
|
3 |
import threading # in a separate thread
|
4 |
import gradio as gr # Create a Gradio interface so spaces doesnt timeout
|
5 |
from datetime import datetime
|
6 |
+
import math
|
7 |
|
8 |
def log_message(message):
|
9 |
# Print message with a timestamp
|
10 |
print(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - {message}")
|
11 |
|
12 |
+
|
13 |
+
def useless_computation():
|
14 |
+
while True:
|
15 |
+
# This loop will keep running, performing pointless calculations
|
16 |
+
for i in range(10000):
|
17 |
+
math.sqrt(i) # Taking the square root of numbers without any purpose
|
18 |
+
|
19 |
# Function to run update_embeddings.py periodically
|
20 |
def run_script_periodically():
|
21 |
|
|
|
41 |
else:
|
42 |
|
43 |
print("Today is not Monday, lets check again in some.")
|
44 |
+
|
45 |
+
useless_computation()
|
46 |
|
47 |
# Wait a bit
|
48 |
time.sleep(60 * 60 * 1)
|