Update app.py
Browse files
app.py
CHANGED
|
@@ -238,14 +238,6 @@ def map_onPage(onPage):
|
|
| 238 |
|
| 239 |
return onPage_filename, onPage_prompt
|
| 240 |
|
| 241 |
-
|
| 242 |
-
def echo(request: gr.Request):
|
| 243 |
-
if request:
|
| 244 |
-
print("Request headers dictionary:", request.headers)
|
| 245 |
-
print("IP address:", request.client.host)
|
| 246 |
-
query_params = dict(request.query_params)
|
| 247 |
-
return query_params
|
| 248 |
-
|
| 249 |
## trust-game-llama-2-7b-chat
|
| 250 |
# app.py
|
| 251 |
def construct_input_prompt(chat_history, message, personalized_data):
|
|
@@ -273,16 +265,14 @@ def generate(
|
|
| 273 |
conversation = []
|
| 274 |
|
| 275 |
# Fetch query params - OLD with gradio sdk = 4.20.0 version
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
|
| 280 |
# Fetch query params - NEW with gradio sdk = 4.25.0 version
|
| 281 |
#params = {key: value for key, value in request.query_params.items()}
|
| 282 |
#print('those are the query params')
|
| 283 |
#print(params)
|
| 284 |
-
|
| 285 |
-
params = echo(request)
|
| 286 |
|
| 287 |
# Assuming params = request.query_params is the dictionary containing the query parameters
|
| 288 |
# Extract the value of the 'session_index' parameter
|
|
|
|
| 238 |
|
| 239 |
return onPage_filename, onPage_prompt
|
| 240 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
## trust-game-llama-2-7b-chat
|
| 242 |
# app.py
|
| 243 |
def construct_input_prompt(chat_history, message, personalized_data):
|
|
|
|
| 265 |
conversation = []
|
| 266 |
|
| 267 |
# Fetch query params - OLD with gradio sdk = 4.20.0 version
|
| 268 |
+
params = request.query_params
|
| 269 |
+
print('those are the query params')
|
| 270 |
+
print(params)
|
| 271 |
|
| 272 |
# Fetch query params - NEW with gradio sdk = 4.25.0 version
|
| 273 |
#params = {key: value for key, value in request.query_params.items()}
|
| 274 |
#print('those are the query params')
|
| 275 |
#print(params)
|
|
|
|
|
|
|
| 276 |
|
| 277 |
# Assuming params = request.query_params is the dictionary containing the query parameters
|
| 278 |
# Extract the value of the 'session_index' parameter
|