Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,14 +37,19 @@ with demo:
|
|
| 37 |
team for generously sharing their code and best
|
| 38 |
practices, ensuring that AI Developers have a valuable and enjoyable tool at their disposal.""")
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
with gr.Accordion("Chat with Top Models on the Leaderboard Here 💬", open=False):
|
| 50 |
# import pdb
|
|
|
|
| 37 |
team for generously sharing their code and best
|
| 38 |
practices, ensuring that AI Developers have a valuable and enjoyable tool at their disposal.""")
|
| 39 |
|
| 40 |
+
def get_host_ip():
|
| 41 |
+
try:
|
| 42 |
+
# Create a socket connection to a public DNS server
|
| 43 |
+
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
| 44 |
+
s.connect(("8.8.8.8", 80)) # Google's public DNS server
|
| 45 |
+
IP = s.getsockname()[0]
|
| 46 |
+
s.close()
|
| 47 |
+
except Exception as e:
|
| 48 |
+
IP = "Unable to obtain IP: " + str(e)
|
| 49 |
+
return IP
|
| 50 |
+
|
| 51 |
+
server_ip = get_host_ip()
|
| 52 |
+
gr.Markdown(f"ip: {server_ip}")
|
| 53 |
|
| 54 |
with gr.Accordion("Chat with Top Models on the Leaderboard Here 💬", open=False):
|
| 55 |
# import pdb
|