arahrooh commited on
Commit
dffdda5
·
1 Parent(s): 4c09fcb

Fix AttributeError: use property for args instead of direct assignment

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -175,9 +175,14 @@ class InferenceAPIBot:
175
  self.bot = bot # Use bot for vector DB and formatting
176
  self.client = InferenceClient(api_key=hf_token)
177
  self.current_model = bot.args.model
178
- self.args = bot.args # Expose args for compatibility
179
  logger.info(f"InferenceAPIBot initialized with model: {self.current_model}")
180
 
 
 
 
 
 
181
  def generate_answer(self, prompt: str, **kwargs) -> str:
182
  """Generate answer using Inference API"""
183
  try:
 
175
  self.bot = bot # Use bot for vector DB and formatting
176
  self.client = InferenceClient(api_key=hf_token)
177
  self.current_model = bot.args.model
178
+ # Don't set args as attribute - access via bot.args instead
179
  logger.info(f"InferenceAPIBot initialized with model: {self.current_model}")
180
 
181
+ @property
182
+ def args(self):
183
+ """Access args from the wrapped bot"""
184
+ return self.bot.args
185
+
186
  def generate_answer(self, prompt: str, **kwargs) -> str:
187
  """Generate answer using Inference API"""
188
  try: