Skip to content

Commit

Permalink
http examples
Browse files Browse the repository at this point in the history
  • Loading branch information
olegklimov committed Oct 19, 2023
1 parent 51b58aa commit a93411b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/http_caps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
curl http://127.0.0.1:8001/v1/caps
15 changes: 15 additions & 0 deletions examples/http_chat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
curl http://127.0.0.1:8001/v1/chat -k \
-H 'Content-Type: application/json' \
-d '{
"messages": [
{"role": "user", "content": "Who is Bill Clinton? What is his favorite programming language?"}
],
"stream": true,
"parameters": {
"temperature": 0.1,
"max_new_tokens": 1000
}
}'

# Other possible parameters:
# "model": "meta-llama/Llama-2-70b-chat-hf",
22 changes: 22 additions & 0 deletions examples/http_completion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
curl http://127.0.0.1:8001/v1/code-completion -k \
-H 'Content-Type: application/json' \
-d '{
"inputs": {
"sources": {"hello.py": "def hello_world():"},
"cursor": {
"file": "hello.py",
"line": 0,
"character": 18
},
"multiline": true
},
"stream": false,
"parameters": {
"temperature": 0.1,
"max_new_tokens": 20
}
}'

# Other possible parameters:
# "scratchpad": "FIM-PSM",
# "model": "smallcloudai/Refact-1_6b-fim",

0 comments on commit a93411b

Please sign in to comment.