|
import os |
|
import gradio as gr |
|
import numpy as np |
|
import random |
|
import torch |
|
import subprocess |
|
import time |
|
import requests |
|
import json |
|
import socket |
|
import subprocess |
|
|
|
hostname = socket.gethostname() |
|
|
|
IPAddr=socket.gethostbyname(hostname) |
|
print("Your Computer Name is:"+hostname) |
|
print("Your Computer IP Address is:"+IPAddr) |
|
|
|
|
|
|
|
|
|
url = "https://146.152.226.61" |
|
|
|
|
|
|
|
try: |
|
resp1 = requests.get("http://3.231.107.102") |
|
if resp1.status_code == 200: |
|
print(resp1.status_code) |
|
print(resp1.text) |
|
print('Okay, I can connect to aws free test server.') |
|
except: |
|
print('The app is having issues! please check first!') |
|
|
|
while True: |
|
print('Begining access to the almighty Intel DevCloud.......') |
|
try: |
|
resp2 = requests.get(url) |
|
if resp2.status_code == 200: |
|
print('Oh yeah, you are smart!') |
|
break |
|
else: |
|
print('Oh no, you are getting smart! Work harder!') |
|
print(resp2.status_code) |
|
print(resp2.text) |
|
except requests.exceptions.RequestException as e: |
|
print('Oh no, no connection!') |
|
print(e) |
|
time.sleep(5) |
|
|