jungsin3 commited on
Commit
4fcf1f1
·
verified ·
1 Parent(s): 82e57e4

README: show inference code example inline

Browse files
Files changed (1) hide show
  1. README.md +26 -4
README.md CHANGED
@@ -79,6 +79,8 @@ KORMo-Web-9B outperforms open web agents of similar size in both English and Kor
79
 
80
  Tested with **vLLM 0.23.0** and **transformers 5.12.1**. The model runs on a single GPU (TP=1).
81
 
 
 
82
  **1. Install and download**
83
 
84
  ```bash
@@ -103,8 +105,9 @@ python KORMo-Web-9B/examples/agent_playwright.py --model KORMo-Web-9B \
103
 
104
  The agent opens Chromium, prints each action as it goes, and finishes with the model's answer.
105
 
106
- <details>
107
- <summary><b>Use the model from your own code (one step)</b></summary>
 
108
 
109
  ```python
110
  import base64, json
@@ -130,11 +133,30 @@ out = client.chat.completions.create(
130
  temperature=0.6, top_p=0.95, max_tokens=16384,
131
  extra_body={"top_k": 20, "chat_template_kwargs": {"enable_thinking": True}},
132
  )
133
- print(out.choices[0].message.content) # <think> … </think> <tool_call><function=click> … </tool_call>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  ```
135
 
136
  Coordinates in the tool call are normalized to 0–1000. Convert them to pixels with `x / 1000 × width` and `y / 1000 × height`.
137
- </details>
138
 
139
  ## How It Works
140
 
 
79
 
80
  Tested with **vLLM 0.23.0** and **transformers 5.12.1**. The model runs on a single GPU (TP=1).
81
 
82
+ ### Run the agent
83
+
84
  **1. Install and download**
85
 
86
  ```bash
 
105
 
106
  The agent opens Chromium, prints each action as it goes, and finishes with the model's answer.
107
 
108
+ ### Inference example (one step)
109
+
110
+ Send one screenshot with the request and get back one action:
111
 
112
  ```python
113
  import base64, json
 
133
  temperature=0.6, top_p=0.95, max_tokens=16384,
134
  extra_body={"top_k": 20, "chat_template_kwargs": {"enable_thinking": True}},
135
  )
136
+ print(out.choices[0].message.content)
137
+ ```
138
+
139
+ The output looks like this (illustrative):
140
+
141
+ ```text
142
+ <think>
143
+ I can see the Google home page with an empty search box in the center. I have not searched yet.
144
+ My plan: 1. Click the search box. 2. Type "KAIST". 3. Press Enter and open the official site.
145
+ </think>
146
+
147
+ <tool_call>
148
+ <function=click>
149
+ <parameter=x>
150
+ 500
151
+ </parameter>
152
+ <parameter=y>
153
+ 427
154
+ </parameter>
155
+ </function>
156
+ </tool_call>
157
  ```
158
 
159
  Coordinates in the tool call are normalized to 0–1000. Convert them to pixels with `x / 1000 × width` and `y / 1000 × height`.
 
160
 
161
  ## How It Works
162