Move file processing from UI to DocSum backend service (#1899)
Signed-off-by: Melanie Buehler <melanie.h.buehler@intel.com>
This commit is contained in:
committed by
GitHub
parent
f6013b8679
commit
7bb05585b6
@@ -161,13 +161,16 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "language=en" \
|
||||
```
|
||||
|
||||
Note that the `-F "messages="` flag is required, even for file uploads. Multiple files can be uploaded in a single call with multiple `-F "files=@/path"` inputs.
|
||||
|
||||
### Query with audio and video
|
||||
|
||||
> Audio and Video file uploads are not supported in docsum with curl request, please use the Gradio-UI.
|
||||
> Audio and video can be passed as base64 strings or uploaded by providing a local file path.
|
||||
|
||||
Audio:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "audio", "messages": "UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"}'
|
||||
@@ -179,11 +182,21 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=audio" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp3, .wav)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
Video:
|
||||
|
||||
```bash
|
||||
# Send base64 string
|
||||
curl -X POST http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"type": "video", "messages": "convert your video to base64 data type"}'
|
||||
@@ -195,6 +208,15 @@ curl http://${host_ip}:8888/v1/docsum \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en" \
|
||||
-F "stream=True"
|
||||
|
||||
# Upload file
|
||||
curl http://${host_ip}:8888/v1/docsum \
|
||||
-H "Content-Type: multipart/form-data" \
|
||||
-F "type=video" \
|
||||
-F "messages=" \
|
||||
-F "files=@/path to your file (.mp4)" \
|
||||
-F "max_tokens=32" \
|
||||
-F "language=en"
|
||||
```
|
||||
|
||||
### Query with long context
|
||||
|
||||
Reference in New Issue
Block a user