This folder contains sample code for running the CogVLM2-Video model.
Before executing the code, please make sure that the dependencies in basic_demo
and the additional dependencies in the current folder have been correctly installed.
pip install -r requirements.txt
Run this code to start a conversation in the command line. Please note that to run this code, the model must be loaded on a GPU
CUDA_VISIBLE_DEVICES=0 python cli_demo.py
Run this code to launch a Restful API server:
python api_demo.py
This will start a Restful API on the 5000 port. Run following code to make a request to the server:
python test_api.py
After launch the Restful API server, you can run this code to start a Gradio web demo:
python gradio_demo.py
Then open the browser and visit http://0.0.0.0:7868/
to chat with the model.