Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import mysql.connector
|
|
5 |
from transformers import pipeline # Assuming you'll use Hugging Face pipeline
|
6 |
import email, imaplib, json, time
|
7 |
import logging
|
8 |
-
|
9 |
|
10 |
# Configure logging
|
11 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
@@ -239,18 +239,6 @@ with gr.Blocks() as demo:
|
|
239 |
|
240 |
# Add a manual timer without the interval parameter
|
241 |
# gr.Timer.every(2, fn=update_status, outputs=status_display) # Run `update_status()` every 2 seconds
|
242 |
-
|
243 |
-
def ping_test(hostname):
|
244 |
-
try:
|
245 |
-
# Run the ping command for 4 packets
|
246 |
-
result = subprocess.run(['ping', '-c', '4', www.google.com], stdout=subprocess.PIPE, text=True)
|
247 |
-
output = result.stdout
|
248 |
-
if "0% packet loss" in output:
|
249 |
-
return f"Ping successful:\n{output}"
|
250 |
-
else:
|
251 |
-
return f"Ping failed:\n{output}"
|
252 |
-
except Exception as e:
|
253 |
-
return f"Error running ping command: {e}"
|
254 |
|
255 |
if __name__ == "__main__":
|
256 |
logging.info('Starting project...')
|
|
|
5 |
from transformers import pipeline # Assuming you'll use Hugging Face pipeline
|
6 |
import email, imaplib, json, time
|
7 |
import logging
|
8 |
+
|
9 |
|
10 |
# Configure logging
|
11 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
|
|
239 |
|
240 |
# Add a manual timer without the interval parameter
|
241 |
# gr.Timer.every(2, fn=update_status, outputs=status_display) # Run `update_status()` every 2 seconds
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
|
243 |
if __name__ == "__main__":
|
244 |
logging.info('Starting project...')
|