baohuynhbk14 commited on
Commit
9d9ede7
·
1 Parent(s): 6956a0a

Refactor http_bot to include conversation history in prediction function

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -249,8 +249,16 @@ def http_bot(
249
  logger.info(f"==== User message ====\n{message}")
250
  logger.info(f"==== Image paths ====\n{all_image_paths}")
251
 
252
- logger.info(f"==== History ====\n{state.get_prompt()}")
253
- response, conv_history = predict(message, all_image_paths[0], max_input_tiles, temperature, max_new_tokens, top_p, repetition_penalty)
 
 
 
 
 
 
 
 
254
  logger.info(f"==== AI history ====\n{conv_history}")
255
 
256
 
 
249
  logger.info(f"==== User message ====\n{message}")
250
  logger.info(f"==== Image paths ====\n{all_image_paths}")
251
 
252
+ history = state.get_prompt()
253
+ logger.info(f"==== History ====\n{history}")
254
+ response, conv_history = predict(message,
255
+ all_image_paths[0],
256
+ history,
257
+ max_input_tiles,
258
+ temperature,
259
+ max_new_tokens,
260
+ top_p,
261
+ repetition_penalty)
262
  logger.info(f"==== AI history ====\n{conv_history}")
263
 
264