mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
- Added methods to check for meaningful content after <think> blocks and to retrieve messages up to the last complete assistant turn. - Introduced retry logic for handling truncated responses and invalid JSON arguments in tool calls, with a maximum retry limit. - Improved logging for invalid JSON and empty responses, ensuring better error tracking and handling. - Updated the batch data generation script to adjust dataset file, batch size, and ephemeral system prompt for improved context management.
26 lines
1.7 KiB
Bash
Executable File
26 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Create logs directory if it doesn't exist
|
|
mkdir -p logs
|
|
|
|
# Generate log filename with timestamp
|
|
LOG_FILE="logs/glm4.7-thinking-sft1_$(date +%Y%m%d_%H%M%S).log"
|
|
|
|
echo "📝 Logging output to: $LOG_FILE"
|
|
|
|
python batch_runner.py \
|
|
--dataset_file="source-data/hermes-agent-agent-tasks-1/agent_tasks_sft_2.jsonl" \
|
|
--batch_size=20 \
|
|
--run_name="megascience_glm4.7-thinking-sft2" \
|
|
--distribution="science" \
|
|
--model="z-ai/glm-4.7" \
|
|
--base_url="https://openrouter.ai/api/v1" \
|
|
--providers_allowed="gmicloud,siliconflow,atlas-cloud,z-ai,novita" \
|
|
--num_workers=15 \
|
|
--max_turns=60 \
|
|
--ephemeral_system_prompt="You have access to a variety of tools to help you solve scientific, math, and technology problems presented to you. You can use them in sequence and build off of the results of prior tools you've used results. Always use the terminal or search tool if it can provide additional context, verify formulas, double check concepts and recent studies and understanding, doing all calculations, etc. You should only be confident in your own reasoning, knowledge, or calculations if you've exhaustively used all tools available to you to that can help you verify or validate your work. Always pip install any packages you need to use the python scripts you want to run. If you need to use a tool that isn't available, you can use the terminal tool to install or create it in many cases as well. Do not use the terminal tool to communicate with the user, as they cannot see your commands, only your final response after completing the task. Search for at least 3 sources, but not more than 12, so you can maintain focused context." \
|
|
2>&1 | tee "$LOG_FILE"
|
|
|
|
echo "✅ Log saved to: $LOG_FILE"
|
|
|
|
# --verbose \ |