EkhiAzur commited on
Commit
f8bc593
1 Parent(s): 43da25f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -22,6 +22,7 @@ classifier = pipeline("text-classification", tokenizer=tokenizer, model=model, m
22
  adibideak = json.load(open("./Adibideak.json", "r"))
23
 
24
  def prozesatu(Testua, request: gr.Request):
 
25
  client_ip = request.client.host
26
  local_ip = socket.gethostbyname(socket.gethostbyname(""))
27
  headers = request.kwargs['headers']
@@ -29,6 +30,10 @@ def prozesatu(Testua, request: gr.Request):
29
  x_forwarded_for = headers['x-forwarded-for']
30
  client_ip = x_forwarded_for.split(' ')[0] if x_forwarded_for else ""
31
 
 
 
 
 
32
  f = open("Erabiltzaileak.txt", "a")
33
 
34
  f.write(f'Erabiltzailea: {client_ip}. Eguna eta ordua: {now}.\n')
 
22
  adibideak = json.load(open("./Adibideak.json", "r"))
23
 
24
  def prozesatu(Testua, request: gr.Request):
25
+ #Ip-a lortzeko kontuak
26
  client_ip = request.client.host
27
  local_ip = socket.gethostbyname(socket.gethostbyname(""))
28
  headers = request.kwargs['headers']
 
30
  x_forwarded_for = headers['x-forwarded-for']
31
  client_ip = x_forwarded_for.split(' ')[0] if x_forwarded_for else ""
32
 
33
+ # Eguna eta ordua lortu
34
+ now = datetime.now()
35
+
36
+ #Fitxategian gorde
37
  f = open("Erabiltzaileak.txt", "a")
38
 
39
  f.write(f'Erabiltzailea: {client_ip}. Eguna eta ordua: {now}.\n')