Update app.py
Browse files
app.py
CHANGED
|
@@ -239,7 +239,7 @@ def construct_input_prompt(chat_history, message):
|
|
| 239 |
def generate(
|
| 240 |
request: gr.Request, # In order to fetch query params
|
| 241 |
message: str,
|
| 242 |
-
input_prompt: str,
|
| 243 |
chat_history: list[tuple[str, str]],
|
| 244 |
max_new_tokens: int = 1024,
|
| 245 |
temperature: float = 0.6,
|
|
@@ -253,6 +253,17 @@ def generate(
|
|
| 253 |
print('those are the query params')
|
| 254 |
print(params)
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
# Construct the input prompt using the functions from the construct_input_prompt function
|
| 257 |
input_prompt = construct_input_prompt(chat_history, message)
|
| 258 |
|
|
|
|
| 239 |
def generate(
|
| 240 |
request: gr.Request, # In order to fetch query params
|
| 241 |
message: str,
|
| 242 |
+
#input_prompt: str,
|
| 243 |
chat_history: list[tuple[str, str]],
|
| 244 |
max_new_tokens: int = 1024,
|
| 245 |
temperature: float = 0.6,
|
|
|
|
| 253 |
print('those are the query params')
|
| 254 |
print(params)
|
| 255 |
|
| 256 |
+
# Assuming params = request.query_params is the dictionary containing the query parameters
|
| 257 |
+
# Extract the value of the 'session_index' parameter
|
| 258 |
+
session_index_value = params.get('session_index')
|
| 259 |
+
|
| 260 |
+
# Check if session_index_value is None or contains a value
|
| 261 |
+
if session_index_value is not None:
|
| 262 |
+
print("Session index:", session_index_value)
|
| 263 |
+
else:
|
| 264 |
+
print("Session index parameter not found or has no value.")
|
| 265 |
+
|
| 266 |
+
|
| 267 |
# Construct the input prompt using the functions from the construct_input_prompt function
|
| 268 |
input_prompt = construct_input_prompt(chat_history, message)
|
| 269 |
|