zlmqi commited on
Commit
89ccb7e
1 Parent(s): 976a15b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -94,8 +94,12 @@ class Chatbot:
94
  #self.chat_history = []
95
  dt = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
96
  #print(dt)
97
- hostname = socket.gethostname()
98
- ip = socket.gethostbyname(hostname)
 
 
 
 
99
  #print(ip)
100
 
101
  #self.chat_history.append({"role": "datetime", "content": dt})
 
94
  #self.chat_history = []
95
  dt = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
96
  #print(dt)
97
+
98
+ #hostname = socket.gethostname() # this returns server hostname
99
+ #ip = socket.gethostbyname(hostname)
100
+ client_socket = socket.socket()
101
+ client_socket.connect(("huggingface.co",80))
102
+ ip = client_socket.getpeername()[0]
103
  #print(ip)
104
 
105
  #self.chat_history.append({"role": "datetime", "content": dt})