mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
update API documentation with examples to list/load models (#5902)
This commit is contained in:
parent
1124f71cf3
commit
c24966c591
@ -19,7 +19,7 @@ Add `--api` to your command-line flags.
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
For the documentation with all the parameters and their types, consult `http://127.0.0.1:5000/docs` or the [typing.py](https://github.com/oobabooga/text-generation-webui/blob/main/extensions/openai/typing.py) file.
|
For the documentation with all the endpoints, parameters and their types, consult `http://127.0.0.1:5000/docs` or the [typing.py](https://github.com/oobabooga/text-generation-webui/blob/main/extensions/openai/typing.py) file.
|
||||||
|
|
||||||
The official examples in the [OpenAI documentation](https://platform.openai.com/docs/api-reference) should also work, and the same parameters apply (although the API here has more optional parameters).
|
The official examples in the [OpenAI documentation](https://platform.openai.com/docs/api-reference) should also work, and the same parameters apply (although the API here has more optional parameters).
|
||||||
|
|
||||||
@ -114,6 +114,30 @@ curl -k http://127.0.0.1:5000/v1/internal/logits \
|
|||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### List models
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl -k http://127.0.0.1:5000/v1/internal/model/list \
|
||||||
|
-H "Content-Type: application/json"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Load model
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl -k http://127.0.0.1:5000/v1/internal/model/load \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d '{
|
||||||
|
"model_name": "model_name",
|
||||||
|
"args": {
|
||||||
|
"load_in_4bit": true,
|
||||||
|
"n_gpu_layers": 12
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"instruction_template": "Alpaca"
|
||||||
|
}
|
||||||
|
}'
|
||||||
|
```
|
||||||
|
|
||||||
#### Python chat example
|
#### Python chat example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
Loading…
Reference in New Issue
Block a user