Image-Text-to-Text
Transformers
Safetensors
English
gemma4
blip-live
video
streaming
merged
conversational
Instructions to use Salesforce/BLIP-Live-Gemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salesforce/BLIP-Live-Gemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Salesforce/BLIP-Live-Gemma") 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("Salesforce/BLIP-Live-Gemma") model = AutoModelForMultimodalLM.from_pretrained("Salesforce/BLIP-Live-Gemma", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Salesforce/BLIP-Live-Gemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Salesforce/BLIP-Live-Gemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Salesforce/BLIP-Live-Gemma", "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/Salesforce/BLIP-Live-Gemma
- SGLang
How to use Salesforce/BLIP-Live-Gemma 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 "Salesforce/BLIP-Live-Gemma" \ --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": "Salesforce/BLIP-Live-Gemma", "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 "Salesforce/BLIP-Live-Gemma" \ --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": "Salesforce/BLIP-Live-Gemma", "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 Salesforce/BLIP-Live-Gemma with Docker Model Runner:
docker model run hf.co/Salesforce/BLIP-Live-Gemma
|
Download CODE_OF_CONDUCT.md from Salesforce/BLIP-Live-Gemma: direct link, hf CLI and curl.
- Browser
- Download file 5.11 kB
-
https://huggingface.co/Salesforce/BLIP-Live-Gemma/resolve/main/CODE_OF_CONDUCT.md
- Command line
-
hf download hf://Salesforce/BLIP-Live-Gemma/CODE_OF_CONDUCT.md
-
curl -L -o CODE_OF_CONDUCT.md https://huggingface.co/Salesforce/BLIP-Live-Gemma/resolve/main/CODE_OF_CONDUCT.md
5.11 kB
| # Salesforce Open Source Community Code of Conduct | |
| ## About the Code of Conduct | |
| Equality is a core value at Salesforce. We believe a diverse and inclusive | |
| community fosters innovation and creativity, and are committed to building a | |
| culture where everyone feels included. | |
| Salesforce open-source projects are committed to providing a friendly, safe, and | |
| welcoming environment for all, regardless of gender identity and expression, | |
| sexual orientation, disability, physical appearance, body size, ethnicity, nationality, | |
| race, age, religion, level of experience, education, socioeconomic status, or | |
| other similar personal characteristics. | |
| The goal of this code of conduct is to specify a baseline standard of behavior so | |
| that people with different social values and communication styles can work | |
| together effectively, productively, and respectfully in our open source community. | |
| It also establishes a mechanism for reporting issues and resolving conflicts. | |
| All questions and reports of abusive, harassing, or otherwise unacceptable behavior | |
| in a Salesforce open-source project may be reported by contacting the Salesforce | |
| Open Source Conduct Committee at ossconduct@salesforce.com. | |
| ## Our Pledge | |
| In the interest of fostering an open and welcoming environment, we as | |
| contributors and maintainers pledge to making participation in our project and | |
| our community a harassment-free experience for everyone, regardless of gender | |
| identity and expression, sexual orientation, disability, physical appearance, | |
| body size, ethnicity, nationality, race, age, religion, level of experience, education, | |
| socioeconomic status, or other similar personal characteristics. | |
| ## Our Standards | |
| Examples of behavior that contributes to creating a positive environment | |
| include: | |
| * Using welcoming and inclusive language | |
| * Being respectful of differing viewpoints and experiences | |
| * Gracefully accepting constructive criticism | |
| * Focusing on what is best for the community | |
| * Showing empathy toward other community members | |
| Examples of unacceptable behavior by participants include: | |
| * The use of sexualized language or imagery and unwelcome sexual attention or | |
| advances | |
| * Personal attacks, insulting/derogatory comments, or trolling | |
| * Public or private harassment | |
| * Publishing, or threatening to publish, others' private information—such as | |
| a physical or electronic address—without explicit permission | |
| * Other conduct which could reasonably be considered inappropriate in a | |
| professional setting | |
| * Advocating for or encouraging any of the above behaviors | |
| ## Our Responsibilities | |
| Project maintainers are responsible for clarifying the standards of acceptable | |
| behavior and are expected to take appropriate and fair corrective action in | |
| response to any instances of unacceptable behavior. | |
| Project maintainers have the right and responsibility to remove, edit, or | |
| reject comments, commits, code, wiki edits, issues, and other contributions | |
| that are not aligned with this Code of Conduct, or to ban temporarily or | |
| permanently any contributor for other behaviors that they deem inappropriate, | |
| threatening, offensive, or harmful. | |
| ## Scope | |
| This Code of Conduct applies both within project spaces and in public spaces | |
| when an individual is representing the project or its community. Examples of | |
| representing a project or community include using an official project email | |
| address, posting via an official social media account, or acting as an appointed | |
| representative at an online or offline event. Representation of a project may be | |
| further defined and clarified by project maintainers. | |
| ## Enforcement | |
| Instances of abusive, harassing, or otherwise unacceptable behavior may be | |
| reported by contacting the Salesforce Open Source Conduct Committee | |
| at ossconduct@salesforce.com. All complaints will be reviewed and investigated | |
| and will result in a response that is deemed necessary and appropriate to the | |
| circumstances. The committee is obligated to maintain confidentiality with | |
| regard to the reporter of an incident. Further details of specific enforcement | |
| policies may be posted separately. | |
| Project maintainers who do not follow or enforce the Code of Conduct in good | |
| faith may face temporary or permanent repercussions as determined by other | |
| members of the project's leadership and the Salesforce Open Source Conduct | |
| Committee. | |
| ## Attribution | |
| This Code of Conduct is adapted from the [Contributor Covenant][contributor-covenant-home], | |
| version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html. | |
| It includes adaptations and additions from [Go Community Code of Conduct][golang-coc], | |
| [CNCF Code of Conduct][cncf-coc], and [Microsoft Open Source Code of Conduct][microsoft-coc]. | |
| This Code of Conduct is licensed under the [Creative Commons Attribution 3.0 License][cc-by-3-us]. | |
| [contributor-covenant-home]: https://www.contributor-covenant.org | |
| [golang-coc]: https://golang.org/conduct | |
| [cncf-coc]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md | |
| [microsoft-coc]: https://opensource.microsoft.com/codeofconduct/ | |
| [cc-by-3-us]: https://creativecommons.org/licenses/by/3.0/us/ | |