nestole commited on
Commit
1ceac94
·
verified ·
1 Parent(s): 8d4f7be

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +13 -2
run.py CHANGED
@@ -234,7 +234,18 @@ def responsecritical(
234
  return False
235
  else:
236
  return True
237
-
 
 
 
 
 
 
 
 
 
 
 
238
 
239
  def response(
240
  request: gr.Request, prompt,history, temperature=0.9, max_new_tokens=500, top_p=0.95, repetition_penalty=1.0,
@@ -251,7 +262,7 @@ def response(
251
  seed=42,
252
  )
253
  full_url = request.url
254
- print("full_url")
255
  print(full_url)
256
  headers = request.headers
257
  IP, dev = extract_ip_and_device(headers)
 
234
  return False
235
  else:
236
  return True
237
+
238
+ def get_value_after_question_mark(url):
239
+ # Find the position of the question mark
240
+ question_mark_index = url.find('?')
241
+
242
+ # Extract the part after the question mark
243
+ if question_mark_index != -1:
244
+ value_after_question_mark = url[question_mark_index + 1:].split('=')[0]
245
+ else:
246
+ value_after_question_mark = ""
247
+
248
+ return value_after_question_mark
249
 
250
  def response(
251
  request: gr.Request, prompt,history, temperature=0.9, max_new_tokens=500, top_p=0.95, repetition_penalty=1.0,
 
262
  seed=42,
263
  )
264
  full_url = request.url
265
+ IDval= get_value_after_question_mark(full_url)
266
  print(full_url)
267
  headers = request.headers
268
  IP, dev = extract_ip_and_device(headers)