https://github.com/roboflow/cog-vlm-client
Simple CogVLM client script
https://github.com/roboflow/cog-vlm-client
Last synced: about 1 year ago
JSON representation
Simple CogVLM client script
- Host: GitHub
- URL: https://github.com/roboflow/cog-vlm-client
- Owner: roboflow
- Created: 2023-12-19T13:03:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-20T15:07:27.000Z (over 2 years ago)
- Last Synced: 2025-05-05T00:02:23.351Z (about 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 14
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cog-vlm-client
## 👋 hello
This script is designed to send an image and a prompt to
[inference](https://github.com/roboflow/inference) server running the
[CogVLM](https://github.com/THUDM/CogVLM) model.
## 💻 install
- clone repository and navigate to root directory
```bash
git clone https://github.com/roboflow/cog-vlm-client.git
cd cog-vlm-client
```
- setup python environment and activate it [optional]
```bash
python3 -m venv venv
source venv/bin/activate
```
- install required dependencies
```bash
pip install -r requirements.txt
```
- download example image
```python
./setup.sh
```
## 🛠️ script arguments
- `--image`: Specifies the path to the image file that will be sent to the inference
server.
- `--prompt`: The prompt text that accompanies the image in the request to the CogVLM
model.
- `--port` (optional): The port number of the API. Defaults to `9001` if not specified.
- `--address` (optional): The address of the API. Defaults to `http://localhost` if not
specified.
- `--api_key` (optional): The Roboflow API key used for authentication with the API. If
not provided, the script will look for the `ROBOFLOW_API_KEY` environment variable.
## ⚙️ run example
```bash
python script.py --image "data/tire.jpg" --prompt "read serial number from tire"
```