This commit is contained in:
Zheng Kai
2023-08-21 10:49:03 +08:00
parent 866b2f569c
commit 911c1b9f5f
6 changed files with 26 additions and 22 deletions

View File

@@ -32,8 +32,9 @@ rachel: build
scp docker-orca.tar $(RACHEL_HOST):/tmp scp docker-orca.tar $(RACHEL_HOST):/tmp
scp install.sh $(RACHEL_HOST):/tmp scp install.sh $(RACHEL_HOST):/tmp
scp ../../server/build/env.sh $(RACHEL_HOST):/tmp scp ../../server/build/env.sh $(RACHEL_HOST):/tmp
ssh $(RACHEL_HOST) "sed -i '/ES/d' /tmp/env.sh"
ssh $(RACHEL_HOST) "chmod +x /tmp/install.sh && /tmp/install.sh && rm /tmp/install.sh" ssh $(RACHEL_HOST) "chmod +x /tmp/install.sh && /tmp/install.sh && rm /tmp/install.sh"
ssh $(RACHEL_HOST) "rm /tmp/env.sh" # ssh $(RACHEL_HOST) "rm /tmp/env.sh"
nginx: nginx:
scp ../nginx/prod.conf lamia:/etc/nginx/vhost.d/600-orca scp ../nginx/prod.conf lamia:/etc/nginx/vhost.d/600-orca

View File

@@ -2,7 +2,7 @@
TARGET="Lamia" TARGET="Lamia"
if [ "$HOSTNAME" != "$TARGET" ]; then if [ "$HOSTNAME" != "$TARGET" ] && [ "$HOSTNAME" != "Rachel" ]; then
>&2 echo only run in server "$TARGET" >&2 echo only run in server "$TARGET"
exit 1 exit 1
fi fi

View File

@@ -3,9 +3,10 @@
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}" BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl -v "${BASE}/chat/completions" \ curl -v "${BASE}/chat/completions" \
-w "Total time: %{time_total} seconds\n" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \ -H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{ -d '{
"model": "gpt-3.5-turbo", "model": "gpt-3.5-turbo",
"messages": [{"role": "user", "content": "Hello!"}] "messages": [{"role": "user", "content": "Hello!"}]
}' }'

View File

@@ -2,6 +2,7 @@
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}" BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl "${BASE}/completions" \ curl "${BASE}/completions" \
-w "Total time: %{time_total} seconds\n" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \ -H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{ -d '{
@@ -9,4 +10,4 @@ curl "${BASE}/completions" \
"prompt": "Say this is a test", "prompt": "Say this is a test",
"max_tokens": 7, "max_tokens": 7,
"temperature": 0 "temperature": 0
}' }'

View File

@@ -2,5 +2,6 @@
OPENAI_API_KEY="sk-rhjeVT1fkcuarBKnQR6ST$(cat ~/.config/openai)" OPENAI_API_KEY="sk-rhjeVT1fkcuarBKnQR6ST$(cat ~/.config/openai)"
curl https://api.openai.com/v1/models \ curl -s https://api.openai.com/v1/models \
-H "Authorization: Bearer ${OPENAI_API_KEY}" -H "Authorization: Bearer ${OPENAI_API_KEY}" \
| jq . -

View File

@@ -3,7 +3,7 @@
BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}" BASE="${OPENAI_API_BASE:-https://api.openai.com/v1}"
curl -v "${BASE}/moderations" \ curl -v "${BASE}/moderations" \
-w "Total time: %{time_total} seconds\n" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer ${OPENAI_API_KEY}" \ -H "Authorization: Bearer ${OPENAI_API_KEY}" \
-d '{"input": "你媽逼啊"}' \ -d '{"input": "你媽逼啊"}'
| jq . -