File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Gives writing tips for a given text file.
4+ #
5+ # Usage:
6+ #
7+ # ./writing-tips.sh <input-file>
8+
9+ set -euo pipefail
10+
11+ # Can also use other keys such as DEEPINFRA_KEY, GOOGLE_KEY, etc.
12+ # trf will automatically use the right API based on the available keys.
13+ export OPENAI_KEY=" $( cat /path/to/key) "
14+
15+ if [ " $# " -ne 1 ]; then
16+ echo " Error: Exactly one input file argument is required"
17+ echo " Usage: $0 <input-file>"
18+ exit 1
19+ fi
20+
21+ INPUT_FILE=" $1 "
22+
23+ PROMPT="
24+ You are a helpful writing assistant.
25+ Respond with a few suggestions for improving the text.
26+ Use plain text only; no markdown.
27+
28+ Here is the text to check:
29+
30+ "
31+ MODEL=" meta-llama/Meta-Llama-3-8B-Instruct"
32+
33+ (echo " $PROMPT " ; cat " $INPUT_FILE " ) | cargo run -- --verbose chat --model=" $MODEL "
You can’t perform that action at this time.
0 commit comments