Instructions to use mobenta/example-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mobenta/example-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="mobenta/example-model")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("mobenta/example-model") model = AutoModelForImageTextToText.from_pretrained("mobenta/example-model") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use mobenta/example-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mobenta/example-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mobenta/example-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mobenta/example-model
- SGLang
How to use mobenta/example-model 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 "mobenta/example-model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mobenta/example-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "mobenta/example-model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mobenta/example-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mobenta/example-model with Docker Model Runner:
docker model run hf.co/mobenta/example-model
Delete New-notebok.ipynb
Browse files- New-notebok.ipynb +0 -51
New-notebok.ipynb
DELETED
|
@@ -1,51 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"cells": [
|
| 3 |
-
{
|
| 4 |
-
"cell_type": "code",
|
| 5 |
-
"execution_count": null,
|
| 6 |
-
"id": "b0fa8718-51ee-4721-b37b-81f7fc739704",
|
| 7 |
-
"metadata": {},
|
| 8 |
-
"outputs": [],
|
| 9 |
-
"source": [
|
| 10 |
-
"#This is my firt HF notebook"
|
| 11 |
-
]
|
| 12 |
-
},
|
| 13 |
-
{
|
| 14 |
-
"cell_type": "markdown",
|
| 15 |
-
"id": "2b39f1c2-84c2-42cf-a060-ead9398d6b4e",
|
| 16 |
-
"metadata": {},
|
| 17 |
-
"source": [
|
| 18 |
-
"5+5"
|
| 19 |
-
]
|
| 20 |
-
},
|
| 21 |
-
{
|
| 22 |
-
"cell_type": "code",
|
| 23 |
-
"execution_count": null,
|
| 24 |
-
"id": "b3ad24f0-2316-4bb0-a424-b9db54595b1e",
|
| 25 |
-
"metadata": {},
|
| 26 |
-
"outputs": [],
|
| 27 |
-
"source": []
|
| 28 |
-
}
|
| 29 |
-
],
|
| 30 |
-
"metadata": {
|
| 31 |
-
"kernelspec": {
|
| 32 |
-
"display_name": "Python 3 (ipykernel)",
|
| 33 |
-
"language": "python",
|
| 34 |
-
"name": "python3"
|
| 35 |
-
},
|
| 36 |
-
"language_info": {
|
| 37 |
-
"codemirror_mode": {
|
| 38 |
-
"name": "ipython",
|
| 39 |
-
"version": 3
|
| 40 |
-
},
|
| 41 |
-
"file_extension": ".py",
|
| 42 |
-
"mimetype": "text/x-python",
|
| 43 |
-
"name": "python",
|
| 44 |
-
"nbconvert_exporter": "python",
|
| 45 |
-
"pygments_lexer": "ipython3",
|
| 46 |
-
"version": "3.12.4"
|
| 47 |
-
}
|
| 48 |
-
},
|
| 49 |
-
"nbformat": 4,
|
| 50 |
-
"nbformat_minor": 5
|
| 51 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|