userlocallm commited on
Commit
fd5cdea
·
verified ·
1 Parent(s): a5defd2

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -83,7 +83,7 @@ def respond(
83
  keyword_dir = "keyword" # Updated keyword directory
84
  load_and_process_dataset(data_update_path, keyword_dir, db_path)
85
 
86
- # Load the model with the maximum context length and control the maximum number of tokens in the response
87
  llm = Llama(
88
  model_path=model_path,
89
  n_ctx=500, # Set the maximum context length
@@ -99,7 +99,7 @@ def respond(
99
  context = f"{system_prompt}\nUser: {message}\nAssistant: "
100
  truncated_context = truncate_context(context, max_context_tokens)
101
 
102
- response = agent.process_query(user_id, message, context=truncated_context)
103
  except ValueError as e:
104
  logging.error(f"Error during processing: {e}")
105
  response = "Désolé, il y a eu une erreur lors du traitement de votre requête. Veuillez essayer à nouveau."
 
83
  keyword_dir = "keyword" # Updated keyword directory
84
  load_and_process_dataset(data_update_path, keyword_dir, db_path)
85
 
86
+ # Load the model with the maximum context length and control the maximum tokens in the response
87
  llm = Llama(
88
  model_path=model_path,
89
  n_ctx=500, # Set the maximum context length
 
99
  context = f"{system_prompt}\nUser: {message}\nAssistant: "
100
  truncated_context = truncate_context(context, max_context_tokens)
101
 
102
+ response = agent.process_query(user_id, message, truncated_context)
103
  except ValueError as e:
104
  logging.error(f"Error during processing: {e}")
105
  response = "Désolé, il y a eu une erreur lors du traitement de votre requête. Veuillez essayer à nouveau."