Image-Text-to-Text
Transformers
Safetensors
English
xgenmm
feature-extraction
conversational
custom_code
Instructions to use Salesforce/xgen-mm-phi3-mini-base-r-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salesforce/xgen-mm-phi3-mini-base-r-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Salesforce/xgen-mm-phi3-mini-base-r-v1", trust_remote_code=True) 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)# Load model directly from transformers import AutoModelForVision2Seq model = AutoModelForVision2Seq.from_pretrained("Salesforce/xgen-mm-phi3-mini-base-r-v1", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Salesforce/xgen-mm-phi3-mini-base-r-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Salesforce/xgen-mm-phi3-mini-base-r-v1" # 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/xgen-mm-phi3-mini-base-r-v1", "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/xgen-mm-phi3-mini-base-r-v1
- SGLang
How to use Salesforce/xgen-mm-phi3-mini-base-r-v1 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/xgen-mm-phi3-mini-base-r-v1" \ --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/xgen-mm-phi3-mini-base-r-v1", "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/xgen-mm-phi3-mini-base-r-v1" \ --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/xgen-mm-phi3-mini-base-r-v1", "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/xgen-mm-phi3-mini-base-r-v1 with Docker Model Runner:
docker model run hf.co/Salesforce/xgen-mm-phi3-mini-base-r-v1
Update README.md
Browse files
README.md
CHANGED
|
@@ -116,6 +116,8 @@ image stock sites, and curated datasets released by the research community. We h
|
|
| 116 |
The model may be subject to bias from the original data source, as well as bias from LLMs and commercial APIs.
|
| 117 |
We strongly recommend users assess safety and fairness before applying to downstream applications.
|
| 118 |
|
|
|
|
|
|
|
| 119 |
|
| 120 |
# License
|
| 121 |
|
|
|
|
| 116 |
The model may be subject to bias from the original data source, as well as bias from LLMs and commercial APIs.
|
| 117 |
We strongly recommend users assess safety and fairness before applying to downstream applications.
|
| 118 |
|
| 119 |
+
# Ethical Considerations
|
| 120 |
+
This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people’s lives, rights, or safety. For further guidance on use cases, refer to our AUP and AI AUP.
|
| 121 |
|
| 122 |
# License
|
| 123 |
|