11 lines
333 B
Bash
11 lines
333 B
Bash
|
|
#!/bin/bash
|
||
|
|
# Wrapper script for translator model that filters out thinking tags
|
||
|
|
|
||
|
|
if [ -z "$1" ]; then
|
||
|
|
echo "Usage: ./translate.sh \"text to translate\""
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
# Run ollama and filter output
|
||
|
|
ollama run translator "$1" 2>/dev/null | sed 's/<think>.*<\/think>//g' | sed '/^$/d' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//'
|