Instructions to use yasserrmd/smoothie-diffusion-qqp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yasserrmd/smoothie-diffusion-qqp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yasserrmd/smoothie-diffusion-qqp")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yasserrmd/smoothie-diffusion-qqp", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yasserrmd/smoothie-diffusion-qqp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yasserrmd/smoothie-diffusion-qqp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yasserrmd/smoothie-diffusion-qqp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yasserrmd/smoothie-diffusion-qqp
- SGLang
How to use yasserrmd/smoothie-diffusion-qqp 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 "yasserrmd/smoothie-diffusion-qqp" \ --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": "yasserrmd/smoothie-diffusion-qqp", "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 "yasserrmd/smoothie-diffusion-qqp" \ --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": "yasserrmd/smoothie-diffusion-qqp", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yasserrmd/smoothie-diffusion-qqp with Docker Model Runner:
docker model run hf.co/yasserrmd/smoothie-diffusion-qqp
Improve model card: add metadata and links to paper/code
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,16 +1,20 @@
|
|
| 1 |
-
|
| 2 |
---
|
|
|
|
|
|
|
| 3 |
license: mit
|
| 4 |
-
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
# Smoothie: A Diffusion Model for Paraphrase Generation
|
| 8 |
|
| 9 |
[](https://shields.io/)
|
| 10 |
[](https://huggingface.co/datasets/glue)
|
| 11 |
-
[
|
|
| 125 |
# `trust_remote_code=True` is essential to load the custom SmoothieModel architecture
|
| 126 |
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).to(device)
|
| 127 |
model.eval()
|
| 128 |
-
print("
|
|
|
|
| 129 |
|
| 130 |
# --- Prepare Diffusion Components ---
|
| 131 |
print("Preparing the embedding matrix for the diffusion process...")
|
|
@@ -144,7 +149,8 @@ print("Diffusion components are ready.")
|
|
| 144 |
|
| 145 |
# --- Run Inference ---
|
| 146 |
source_question = "How can I become a better writer?"
|
| 147 |
-
print(f"
|
|
|
|
| 148 |
|
| 149 |
inputs = tokenizer(
|
| 150 |
source_question,
|
|
@@ -191,6 +197,4 @@ This model was trained from scratch.
|
|
| 191 |
|
| 192 |
- The model's knowledge is limited to the topics present in the Quora Questions dataset. It may perform poorly on highly specialized or out-of-domain topics.
|
| 193 |
- As with any model trained on large-scale internet text, it may reflect societal biases present in the training data.
|
| 194 |
-
- The model is currently undertrained and may not always produce semantically perfect paraphrases. Continued training would improve its accuracy.
|
| 195 |
-
|
| 196 |
-
```
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
license: mit
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
---
|
| 8 |
|
| 9 |
# Smoothie: A Diffusion Model for Paraphrase Generation
|
| 10 |
|
| 11 |
[](https://shields.io/)
|
| 12 |
[](https://huggingface.co/datasets/glue)
|
| 13 |
+
[](https://huggingface.co/papers/2505.18853)
|
| 14 |
+
|
| 15 |
+
This repository contains a diffusion-based model for text generation, trained on the **Quora Question Pairs (QQP)** dataset for the task of **paraphrasing**. The architecture and training methodology are based on the paper [Smoothie: Smoothing Diffusion on Token Embeddings for Text Generation](https://huggingface.co/papers/2505.18853).
|
| 16 |
|
| 17 |
+
The official code is available at [ashaba1in/smoothie](https://github.com/ashaba1in/smoothie).
|
| 18 |
|
| 19 |
This is a custom model and **requires `trust_remote_code=True`** to load, as the model's architecture is defined in the accompanying `modeling_smoothie.py` file.
|
| 20 |
|
|
|
|
| 129 |
# `trust_remote_code=True` is essential to load the custom SmoothieModel architecture
|
| 130 |
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).to(device)
|
| 131 |
model.eval()
|
| 132 |
+
print("
|
| 133 |
+
Model loaded successfully from the Hub!")
|
| 134 |
|
| 135 |
# --- Prepare Diffusion Components ---
|
| 136 |
print("Preparing the embedding matrix for the diffusion process...")
|
|
|
|
| 149 |
|
| 150 |
# --- Run Inference ---
|
| 151 |
source_question = "How can I become a better writer?"
|
| 152 |
+
print(f"
|
| 153 |
+
Source Question: {source_question}")
|
| 154 |
|
| 155 |
inputs = tokenizer(
|
| 156 |
source_question,
|
|
|
|
| 197 |
|
| 198 |
- The model's knowledge is limited to the topics present in the Quora Questions dataset. It may perform poorly on highly specialized or out-of-domain topics.
|
| 199 |
- As with any model trained on large-scale internet text, it may reflect societal biases present in the training data.
|
| 200 |
+
- The model is currently undertrained and may not always produce semantically perfect paraphrases. Continued training would improve its accuracy.
|
|
|
|
|
|