eduardo-alvarez
commited on
Commit
•
9773d33
1
Parent(s):
92d5c20
Update app.py
Browse files
app.py
CHANGED
@@ -37,19 +37,18 @@ 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 |
try:
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
IP = s.getsockname()[0]
|
46 |
-
s.close()
|
47 |
except Exception as e:
|
48 |
-
|
49 |
-
|
|
|
50 |
|
51 |
-
|
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
|
|
|
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 |
+
def get_public_ip():
|
42 |
try:
|
43 |
+
response = requests.get('https://api.ipify.org')
|
44 |
+
public_ip = response.text
|
45 |
+
return public_ip
|
|
|
|
|
46 |
except Exception as e:
|
47 |
+
return f"Error: {str(e)}"
|
48 |
+
|
49 |
+
public_ip = get_public_ip()
|
50 |
|
51 |
+
gr.Markdown(f"ip: {public_ip}")
|
|
|
52 |
|
53 |
with gr.Accordion("Chat with Top Models on the Leaderboard Here 💬", open=False):
|
54 |
# import pdb
|