feat(ai): add translation AI
This commit is contained in:
parent
2d91d7e87e
commit
e6747c4a97
1 changed files with 18 additions and 0 deletions
18
ai-translate.sh
Executable file
18
ai-translate.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#! /bin/bash
|
||||
|
||||
# Load config
|
||||
. ${HOME}/ayo.conf
|
||||
|
||||
host=$ollama_remote_host
|
||||
model="llama3.1:8b"
|
||||
|
||||
TEMP=$(mktemp)
|
||||
vim $TEMP
|
||||
|
||||
PROMPT="Translate everything that follows into English. Only give me the translated text in English."
|
||||
|
||||
OUTPUT=$(mktemp)
|
||||
|
||||
OLLAMA_HOST=$host ollama run $model "$PROMPT -- " < $TEMP > $OUTPUT
|
||||
|
||||
typora $OUTPUT
|
Loading…
Reference in a new issue