Image-Text-to-Text
Safetensors
English
multilingual
vllm
gemma4
gemma
gemma-4
multimodal
uncensored
general purpose
unsloth
text-generation-inference
conversational
Instructions to use Ryex/Floppa_Gemma4-E4B-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- Unsloth Studio
How to use Ryex/Floppa_Gemma4-E4B-it with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ryex/Floppa_Gemma4-E4B-it to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Ryex/Floppa_Gemma4-E4B-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Ryex/Floppa_Gemma4-E4B-it to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Ryex/Floppa_Gemma4-E4B-it", max_seq_length=2048, )
Update README.md
Browse files
README.md
CHANGED
|
@@ -55,22 +55,46 @@ This model is optimized for **vLLM** and **Text-Generation-Inference**.
|
|
| 55 |
|
| 56 |
```python
|
| 57 |
from vllm import LLM, SamplingParams
|
|
|
|
| 58 |
from PIL import Image
|
| 59 |
|
| 60 |
-
|
| 61 |
llm = LLM(
|
| 62 |
-
model=
|
| 63 |
trust_remote_code=True,
|
| 64 |
-
dtype="bfloat16"
|
|
|
|
| 65 |
)
|
| 66 |
|
| 67 |
-
|
|
|
|
| 68 |
image = Image.open("test_image.jpg").convert("RGB")
|
| 69 |
-
prompt = "<image>\nDescribe this image in detail, including any explicit elements."
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
outputs = llm.generate([inputs], sampling_params=params)
|
| 76 |
print(outputs[0].outputs[0].text)
|
|
|
|
| 55 |
|
| 56 |
```python
|
| 57 |
from vllm import LLM, SamplingParams
|
| 58 |
+
from transformers import AutoProcessor
|
| 59 |
from PIL import Image
|
| 60 |
|
| 61 |
+
model_id = "Ryex/Floppa_Gemma4-E4B-it"
|
| 62 |
llm = LLM(
|
| 63 |
+
model=model_id,
|
| 64 |
trust_remote_code=True,
|
| 65 |
+
dtype="bfloat16",
|
| 66 |
+
max_model_len=8192,
|
| 67 |
)
|
| 68 |
|
| 69 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 70 |
+
|
| 71 |
image = Image.open("test_image.jpg").convert("RGB")
|
|
|
|
| 72 |
|
| 73 |
+
messages = [
|
| 74 |
+
{
|
| 75 |
+
"role": "user",
|
| 76 |
+
"content": [
|
| 77 |
+
{"type": "image"},
|
| 78 |
+
{"type": "text", "text": "Describe this image in detail, including any uncensored or explicit elements."}
|
| 79 |
+
]
|
| 80 |
+
}
|
| 81 |
+
]
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
inputs = {
|
| 88 |
+
"prompt": prompt,
|
| 89 |
+
"multi_modal_data": {"image": image},
|
| 90 |
+
"mm_processor_kwargs": {"max_soft_tokens": 560}
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
params = SamplingParams(
|
| 94 |
+
temperature=0.7,
|
| 95 |
+
max_tokens=1024,
|
| 96 |
+
stop=["<turn|>", "<|turn|>"]
|
| 97 |
+
)
|
| 98 |
|
| 99 |
outputs = llm.generate([inputs], sampling_params=params)
|
| 100 |
print(outputs[0].outputs[0].text)
|