bhatanerohan commited on
Commit
389d546
·
verified ·
1 Parent(s): 07ca993

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -360,8 +360,9 @@ def edit_3d_model(edit_prompt: str, transparent_image_path: str) -> str:
360
  def generate_3d_ui(prompt, request: gr.Request, progress=gr.Progress()):
361
  """UI wrapper with progress updates"""
362
 
363
- # Get client info
364
- client_ip = request.client.host if request else "unknown"
 
365
  location = get_location_from_ip(client_ip)
366
  user_agent = request.headers.get("user-agent", "unknown") if request else "unknown"
367
 
 
360
  def generate_3d_ui(prompt, request: gr.Request, progress=gr.Progress()):
361
  """UI wrapper with progress updates"""
362
 
363
+ client_ip = request.headers.get("x-forwarded-for", "").split(",")[0].strip()
364
+ if not client_ip:
365
+ client_ip = request.client.host if request else "unknown"
366
  location = get_location_from_ip(client_ip)
367
  user_agent = request.headers.get("user-agent", "unknown") if request else "unknown"
368