--- library_name: vllm language: - en - fr - es - de - it - pt - nl - zh - ja - ko - ar license: apache-2.0 inference: false base_model: - mistralai/Ministral-3-3B-Reasoning-2512 extra_gated_description: >- If you want to learn more about how we process your personal data, please read our Privacy Policy. tags: - mistral-common - abliterated - uncensored --- # huihui-ai/Huihui-Ministral-3-3B-Reasoning-2512-abliterated This is an uncensored version of [mistralai/Ministral-3-3B-Reasoning-2512](https://huggingface.co/mistralai/Ministral-3-3B-Reasoning-2512) created with abliteration (see [remove-refusals-with-transformers](https://github.com/Sumandora/remove-refusals-with-transformers) to know more about it). It was only the text part that was processed, not the image part. ## Chat with Image ``` import torch from transformers import Mistral3ForConditionalGeneration, MistralCommonBackend from PIL import Image, ImageOps import base64 import io from datetime import datetime, timedelta import os model_id = "huihui-ai/Huihui-Ministral-3-3B-Reasoning-2512-abliterated" tokenizer = MistralCommonBackend.from_pretrained(model_id, trust_remote_code=True) model = Mistral3ForConditionalGeneration.from_pretrained( model_id, torch_dtype="auto", device_map="auto", trust_remote_code=True, ) model = model.cuda() #image_url = "https://static.wikia.nocookie.net/essentialsdocs/images/7/70/Battle.png/revision/latest?cb=20220523172438" image_path = "/png/Battle.png" with Image.open(image_path) as img: extension_to_format = { ".png": "PNG", ".jpg": "JPEG", ".jpeg": "JPEG" } image_format = extension_to_format.get( "." + image_path.lower().split(".")[-1], "JPEG" ) buffered = io.BytesIO() img.save(buffered, format=image_format) base64_string = base64.b64encode(buffered.getvalue()).decode("utf-8") image_url = f"data:image/{'png' if image_format == 'PNG' else 'jpeg'};base64,{base64_string}" messages = [ { "role": "user", "content": [ { "type": "text", "text": "What action do you think I should take in this situation? List all the possible actions and explain why you think they are good or bad.", }, {"type": "image_url", "image_url": {"url": image_url}}, ], }, ] tokenized = tokenizer.apply_chat_template( messages, add_generation_prompt=True, return_dict=True, return_tensors="pt" ).to("cuda") tokenized["input_ids"] = tokenized["input_ids"].to(device="cuda") tokenized["pixel_values"] = tokenized["pixel_values"].to(dtype=torch.bfloat16, device="cuda") image_sizes = [tokenized["pixel_values"].shape[-2:]] output = model.generate( **tokenized, image_sizes=image_sizes, max_new_tokens=512, )[0] decoded_output = tokenizer.decode(output[len(tokenized["input_ids"][0]):]) print(decoded_output) ``` ### Usage Warnings - **Risk of Sensitive or Controversial Outputs**: This model’s safety filtering has been significantly reduced, potentially generating sensitive, controversial, or inappropriate content. Users should exercise caution and rigorously review generated outputs. - **Not Suitable for All Audiences**: Due to limited content filtering, the model’s outputs may be inappropriate for public settings, underage users, or applications requiring high security. - **Legal and Ethical Responsibilities**: Users must ensure their usage complies with local laws and ethical standards. Generated content may carry legal or ethical risks, and users are solely responsible for any consequences. - **Research and Experimental Use**: It is recommended to use this model for research, testing, or controlled environments, avoiding direct use in production or public-facing commercial applications. - **Monitoring and Review Recommendations**: Users are strongly advised to monitor model outputs in real-time and conduct manual reviews when necessary to prevent the dissemination of inappropriate content. - **No Default Safety Guarantees**: Unlike standard models, this model has not undergone rigorous safety optimization. huihui.ai bears no responsibility for any consequences arising from its use. ### Donation If you like it, please click 'like' and follow us for more updates. You can follow [x.com/support_huihui](https://x.com/support_huihui) to get the latest model information from huihui.ai. ##### Your donation helps us continue our further development and improvement, a cup of coffee can do it. - bitcoin(BTC): ``` bc1qqnkhuchxw0zqjh2ku3lu4hq45hc6gy84uk70ge ``` - Support our work on [Ko-fi](https://ko-fi.com/huihuiai)!