Ali2206 commited on
Commit
70e5ae6
·
verified ·
1 Parent(s): 1244d40

Update src/txagent/txagent.py

Browse files
Files changed (1) hide show
  1. src/txagent/txagent.py +5 -5
src/txagent/txagent.py CHANGED
@@ -74,7 +74,7 @@ class TxAgent:
74
  return f"The model {model_name} is already loaded."
75
  self.model_name = model_name
76
 
77
- self.model = LLM(model=self.model_name, dtype="float16", max_model_len=2048, gpu_memory_utilization=0.8)
78
  self.chat_template = Template(self.model.get_tokenizer().chat_template)
79
  self.tokenizer = self.model.get_tokenizer()
80
  logger.info("Model %s loaded successfully", self.model_name)
@@ -386,8 +386,8 @@ class TxAgent:
386
  temperature=temperature,
387
  tools=picked_tools_prompt,
388
  skip_special_tokens=False,
389
- max_new_tokens=max_new_tokens,
390
- max_token=max_token,
391
  check_token_status=True)
392
  if last_outputs_str is None:
393
  logger.warning("Token limit exceeded")
@@ -603,8 +603,8 @@ Summarize the function calls' responses in one sentence with all necessary infor
603
  def run_gradio_chat(self, message: str,
604
  history: list,
605
  temperature: float,
606
- max_new_tokens: int,
607
- max_token: int,
608
  call_agent: bool,
609
  conversation: gr.State,
610
  max_round: int = 5,
 
74
  return f"The model {model_name} is already loaded."
75
  self.model_name = model_name
76
 
77
+ self.model = LLM(model=self.model_name, dtype="float16", max_model_len=32768, gpu_memory_utilization=0.8)
78
  self.chat_template = Template(self.model.get_tokenizer().chat_template)
79
  self.tokenizer = self.model.get_tokenizer()
80
  logger.info("Model %s loaded successfully", self.model_name)
 
386
  temperature=temperature,
387
  tools=picked_tools_prompt,
388
  skip_special_tokens=False,
389
+ max_new_tokens=2048,
390
+ max_token=32768,
391
  check_token_status=True)
392
  if last_outputs_str is None:
393
  logger.warning("Token limit exceeded")
 
603
  def run_gradio_chat(self, message: str,
604
  history: list,
605
  temperature: float,
606
+ max_new_tokens: 2048,
607
+ max_token: 32768,
608
  call_agent: bool,
609
  conversation: gr.State,
610
  max_round: int = 5,