Instructions to use mrfakename/ReverseBERT-GTE-Base-EN-1.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use mrfakename/ReverseBERT-GTE-Base-EN-1.5 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B-Base") model = PeftModel.from_pretrained(base_model, "mrfakename/ReverseBERT-GTE-Base-EN-1.5") - Transformers
How to use mrfakename/ReverseBERT-GTE-Base-EN-1.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrfakename/ReverseBERT-GTE-Base-EN-1.5") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mrfakename/ReverseBERT-GTE-Base-EN-1.5", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mrfakename/ReverseBERT-GTE-Base-EN-1.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrfakename/ReverseBERT-GTE-Base-EN-1.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrfakename/ReverseBERT-GTE-Base-EN-1.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mrfakename/ReverseBERT-GTE-Base-EN-1.5
- SGLang
How to use mrfakename/ReverseBERT-GTE-Base-EN-1.5 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 "mrfakename/ReverseBERT-GTE-Base-EN-1.5" \ --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": "mrfakename/ReverseBERT-GTE-Base-EN-1.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "mrfakename/ReverseBERT-GTE-Base-EN-1.5" \ --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": "mrfakename/ReverseBERT-GTE-Base-EN-1.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mrfakename/ReverseBERT-GTE-Base-EN-1.5 with Docker Model Runner:
docker model run hf.co/mrfakename/ReverseBERT-GTE-Base-EN-1.5
An experiment, see details: https://github.com/fakerybakery/ReverseBERT. Inspired by https://github.com/vec2text/vec2text
| Overview | Details |
|---|---|
| Embedding Model | https://huggingface.co/Alibaba-NLP/gte-base-en-v1.5 |
| LLM Backbone | https://huggingface.co/Qwen/Qwen3-0.6B-Base |
Overview
Can you go from embeddings back to text?
The setup is pretty simple: take a sentence encoder and freeze it. Then train a small projection layer that maps those embeddings into "soft prompt" tokens for a language model. The LLM learns to reconstruct the original text from just those projected embeddings.
It's far from perfect. You probably can't reconstruct the exact meaning of the text, but you can get the general idea/vibe of the original input.
Usage
See: https://github.com/fakerybakery/ReverseBERT/blob/main/infer.py
Reconstruction samples
| Original | Reconstructed |
|---|---|
| Young adult male, expressing contemplation and sadness, speaking in a calm, reflective tone with a steady pace and falling intonation. | young adult male, expressing Contemplation and Sadness, speaking in a calm, reflective tone with a steady pace and clear articulation. |
| Young adult male, expressing joy and excitement, speaking in an upbeat, energetic tone with a quick pace and rising intonation. | young adult male, expressing high Elation and Amusement, speaking in a cheerful and energetic tone with a moderate pace and rising intonation. |
| Young adult male, expressing anger and frustration, speaking in a tense, sharp tone with an uneven pace and emphatic intonation. | Young adult male, expressing Anger and Contempt, speaking in a tense, frustrated tone with a sharp, clipped pace. |
| Young adult male, expressing fear and anxiety, speaking in a hesitant, wavering tone with a rushed pace and uncertain intonation. | young adult male, expressing nervousness and confusion, speaking in a hesitant, paced tone with a slightly shaky delivery. |
| Young adult male, expressing serenity and contentment, speaking in a soft, gentle tone with a slow pace and level intonation. | young adult male, expressing calm contentment and gentle affection, speaking in a soft, soothing tone with a slow, deliberate pace. |
Credits
As always, huge thanks to Hugging Face 🤗 for supporting the compute used to train this model!
- Downloads last month
- 1
Model tree for mrfakename/ReverseBERT-GTE-Base-EN-1.5
Base model
Qwen/Qwen3-0.6B-Base