Instructions to use thomsonreuters/Thomson-1.0-Small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thomsonreuters/Thomson-1.0-Small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="thomsonreuters/Thomson-1.0-Small") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("thomsonreuters/Thomson-1.0-Small") model = AutoModelForMultimodalLM.from_pretrained("thomsonreuters/Thomson-1.0-Small", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use thomsonreuters/Thomson-1.0-Small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thomsonreuters/Thomson-1.0-Small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thomsonreuters/Thomson-1.0-Small", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/thomsonreuters/Thomson-1.0-Small
- SGLang
How to use thomsonreuters/Thomson-1.0-Small with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "thomsonreuters/Thomson-1.0-Small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thomsonreuters/Thomson-1.0-Small", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "thomsonreuters/Thomson-1.0-Small" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thomsonreuters/Thomson-1.0-Small", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use thomsonreuters/Thomson-1.0-Small with Docker Model Runner:
docker model run hf.co/thomsonreuters/Thomson-1.0-Small
Download LICENSE from thomsonreuters/Thomson-1.0-Small: direct link, hf CLI and curl.
- Browser
- Download file 3.59 kB
-
https://huggingface.co/thomsonreuters/Thomson-1.0-Small/resolve/main/LICENSE
- Command line
-
hf download hf://thomsonreuters/Thomson-1.0-Small/LICENSE
-
curl -L -o LICENSE https://huggingface.co/thomsonreuters/Thomson-1.0-Small/resolve/main/LICENSE
3.59 kB
| # PolyForm Strict License 1.0.0 | |
| <https://polyformproject.org/licenses/strict/1.0.0> | |
| ## Acceptance | |
| In order to get any license under these terms, you must agree | |
| to them as both strict obligations and conditions to all | |
| your licenses. | |
| ## Copyright License | |
| The licensor grants you a copyright license for the software | |
| to do everything you might do with the software that would | |
| otherwise infringe the licensor's copyright in it for any | |
| permitted purpose, other than distributing the software or | |
| making changes or new works based on the software. | |
| ## Patent License | |
| The licensor grants you a patent license for the software that | |
| covers patent claims the licensor can license, or becomes able | |
| to license, that you would infringe by using the software. | |
| ## Noncommercial Purposes | |
| Any noncommercial purpose is a permitted purpose. | |
| ## Personal Uses | |
| Personal use for research, experiment, and testing for | |
| the benefit of public knowledge, personal study, private | |
| entertainment, hobby projects, amateur pursuits, or religious | |
| observance, without any anticipated commercial application, | |
| is use for a permitted purpose. | |
| ## Noncommercial Organizations | |
| Use by any charitable organization, educational institution, | |
| public research organization, public safety or health | |
| organization, environmental protection organization, | |
| or government institution is use for a permitted purpose | |
| regardless of the source of funding or obligations resulting | |
| from the funding. | |
| ## Fair Use | |
| You may have "fair use" rights for the software under the | |
| law. These terms do not limit them. | |
| ## No Other Rights | |
| These terms do not allow you to sublicense or transfer any of | |
| your licenses to anyone else, or prevent the licensor from | |
| granting licenses to anyone else. These terms do not imply | |
| any other licenses. | |
| ## Patent Defense | |
| If you make any written claim that the software infringes or | |
| contributes to infringement of any patent, your patent license | |
| for the software granted under these terms ends immediately. If | |
| your company makes such a claim, your patent license ends | |
| immediately for work on behalf of your company. | |
| ## Violations | |
| The first time you are notified in writing that you have | |
| violated any of these terms, or done anything with the software | |
| not covered by your licenses, your licenses can nonetheless | |
| continue if you come into full compliance with these terms, | |
| and take practical steps to correct past violations, within | |
| 32 days of receiving notice. Otherwise, all your licenses | |
| end immediately. | |
| ## No Liability | |
| ***As far as the law allows, the software comes as is, without | |
| any warranty or condition, and the licensor will not be liable | |
| to you for any damages arising out of these terms or the use | |
| or nature of the software, under any kind of legal claim.*** | |
| ## Definitions | |
| The **licensor** is the individual or entity offering these | |
| terms, and the **software** is the software the licensor makes | |
| available under these terms. | |
| **You** refers to the individual or entity agreeing to these | |
| terms. | |
| **Your company** is any legal entity, sole proprietorship, | |
| or other kind of organization that you work for, plus all | |
| organizations that have control over, are under the control of, | |
| or are under common control with that organization. **Control** | |
| means ownership of substantially all the assets of an entity, | |
| or the power to direct its management and policies by vote, | |
| contract, or otherwise. Control can be direct or indirect. | |
| **Your licenses** are all the licenses granted to you for the | |
| software under these terms. | |
| **Use** means anything you do with the software requiring one | |
| of your licenses. | |