Skip to content

Commit de2507b

Browse files
authored
Update multimodal.md to exercise server as part of test (#1391)
Similar to #1384 to exercise the server , but for multimodal 1 - Run server: 1a - in background 1b - capture server_pid 2 - enable query using curl 3 - shutdown server with server pid captured in server_pid
1 parent 5eac329 commit de2507b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/multimodal.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ python3 torchchat.py server llama3.2-11B
4141
```
4242
[skip default]: end
4343

44+
[shell default]: python3 torchchat.py server llama3.2-11B & server_pid=$!
45+
46+
4447
In another terminal, query the server using `curl`. This query might take a few minutes to respond.
4548

4649
<details>
@@ -50,7 +53,6 @@ Setting `stream` to "true" in the request emits a response in chunks. If `stream
5053

5154
**Example Input + Output**
5255

53-
[skip default]: begin
5456
```
5557
curl http://127.0.0.1:5000/v1/chat/completions \
5658
-H "Content-Type: application/json" \
@@ -74,12 +76,14 @@ curl http://127.0.0.1:5000/v1/chat/completions \
7476
"max_tokens": 300
7577
}'
7678
```
77-
79+
[skip default]: begin
7880
```
7981
{"id": "chatcmpl-cb7b39af-a22e-4f71-94a8-17753fa0d00c", "choices": [{"message": {"role": "assistant", "content": "The image depicts a simple black and white cartoon-style drawing of an animal face. It features a profile view, complete with two ears, expressive eyes, and a partial snout. The animal looks to the left, with its eye and mouth implied, suggesting that the drawn face might belong to a rabbit, dog, or pig. The graphic face has a bold black outline and a smaller, solid black nose. A small circle, forming part of the face, has a white background with two black quirkly short and long curved lines forming an outline of what was likely a mouth, complete with two teeth. The presence of the curve lines give the impression that the animal is smiling or speaking. Grey and black shadows behind the right ear and mouth suggest that this face is looking left and upwards. Given the prominent outline of the head and the outline of the nose, it appears that the depicted face is most likely from the side profile of a pig, although the ears make it seem like a dog and the shape of the nose makes it seem like a rabbit. Overall, it seems that this image, possibly part of a character illustration, is conveying a playful or expressive mood through its design and positioning."}, "finish_reason": "stop"}], "created": 1727487574, "model": "llama3.2", "system_fingerprint": "cpu_torch.float16", "object": "chat.completion"}%
8082
```
8183
[skip default]: end
8284

85+
[shell default]: kill ${server_pid}
86+
8387
</details>
8488

8589
## Browser

0 commit comments

Comments
 (0)