Spaces:
Runtime error
Runtime error
Fix AttributeError: use property for args instead of direct assignment
Browse files
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 |
-
|
| 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:
|