Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,7 +170,7 @@ If earlier context is needed, ask the user to clarify.
|
|
| 170 |
raise ValueError("Mistral API key is required")
|
| 171 |
|
| 172 |
self.model = ChatMistralAI(
|
| 173 |
-
model="
|
| 174 |
api_key=mistral_key,
|
| 175 |
|
| 176 |
)
|
|
@@ -225,7 +225,7 @@ If earlier context is needed, ask the user to clarify.
|
|
| 225 |
agent=agent,
|
| 226 |
tools=tools,
|
| 227 |
verbose=True,
|
| 228 |
-
max_iterations=
|
| 229 |
early_stopping_method="generate",
|
| 230 |
handle_parsing_errors=True,
|
| 231 |
return_intermediate_steps=True,
|
|
@@ -617,15 +617,15 @@ async def main():
|
|
| 617 |
interface = create_interface()
|
| 618 |
|
| 619 |
# Launch interface (this will block)
|
| 620 |
-
|
| 621 |
-
|
| 622 |
server_name="0.0.0.0",
|
| 623 |
server_port=7860,
|
|
|
|
| 624 |
debug=False,
|
| 625 |
show_error=True,
|
| 626 |
quiet=False
|
| 627 |
)
|
| 628 |
-
|
| 629 |
|
| 630 |
except Exception as e:
|
| 631 |
logger.error(f"Application error: {e}")
|
|
|
|
| 170 |
raise ValueError("Mistral API key is required")
|
| 171 |
|
| 172 |
self.model = ChatMistralAI(
|
| 173 |
+
model="mistral-small-latest",
|
| 174 |
api_key=mistral_key,
|
| 175 |
|
| 176 |
)
|
|
|
|
| 225 |
agent=agent,
|
| 226 |
tools=tools,
|
| 227 |
verbose=True,
|
| 228 |
+
max_iterations=15, # Reduced from 30
|
| 229 |
early_stopping_method="generate",
|
| 230 |
handle_parsing_errors=True,
|
| 231 |
return_intermediate_steps=True,
|
|
|
|
| 617 |
interface = create_interface()
|
| 618 |
|
| 619 |
# Launch interface (this will block)
|
| 620 |
+
await asyncio.to_thread(
|
| 621 |
+
interface.launch,
|
| 622 |
server_name="0.0.0.0",
|
| 623 |
server_port=7860,
|
| 624 |
+
share=False,
|
| 625 |
debug=False,
|
| 626 |
show_error=True,
|
| 627 |
quiet=False
|
| 628 |
)
|
|
|
|
| 629 |
|
| 630 |
except Exception as e:
|
| 631 |
logger.error(f"Application error: {e}")
|