Text Generation
Transformers
Safetensors
English
nemotron_h
ai-text-detection
prose-provenance
conversational
Instructions to use rishanthrajendhran/ProseLens with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rishanthrajendhran/ProseLens with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rishanthrajendhran/ProseLens") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rishanthrajendhran/ProseLens") model = AutoModelForCausalLM.from_pretrained("rishanthrajendhran/ProseLens", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rishanthrajendhran/ProseLens with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rishanthrajendhran/ProseLens" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rishanthrajendhran/ProseLens", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rishanthrajendhran/ProseLens
- SGLang
How to use rishanthrajendhran/ProseLens 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 "rishanthrajendhran/ProseLens" \ --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": "rishanthrajendhran/ProseLens", "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 "rishanthrajendhran/ProseLens" \ --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": "rishanthrajendhran/ProseLens", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rishanthrajendhran/ProseLens with Docker Model Runner:
docker model run hf.co/rishanthrajendhran/ProseLens
Card: quick start with the idealens package (classify, extract, score)
Browse files
README.md
CHANGED
|
@@ -33,16 +33,29 @@ identically on outlines, reaches 95.3% and 81.3%; Pangram 4 reaches 98.5% and 25
|
|
| 33 |
|
| 34 |
Pass the document text as is.
|
| 35 |
|
| 36 |
-
###
|
| 37 |
|
| 38 |
-
[idealens](https://github.com/RishanthRajendhran/IdeaLens) ([PyPI](https://pypi.org/project/idealens/)) scores with
|
|
|
|
| 39 |
|
| 40 |
```bash
|
| 41 |
pip install "idealens[vllm]"
|
| 42 |
idealens score docs.jsonl -o scores.jsonl --model ProseLens
|
| 43 |
```
|
| 44 |
|
| 45 |
-
Input is JSONL with a `text` field per document.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
### Load the merged model (66 GB download)
|
| 48 |
|
|
|
|
| 33 |
|
| 34 |
Pass the document text as is.
|
| 35 |
|
| 36 |
+
### Quick start with the idealens package
|
| 37 |
|
| 38 |
+
[idealens](https://github.com/RishanthRajendhran/IdeaLens) ([PyPI](https://pypi.org/project/idealens/)) scores documents with ProseLens on vLLM and applies the thresholds in this repo. No
|
| 39 |
+
outline and no LLM call is needed:
|
| 40 |
|
| 41 |
```bash
|
| 42 |
pip install "idealens[vllm]"
|
| 43 |
idealens score docs.jsonl -o scores.jsonl --model ProseLens
|
| 44 |
```
|
| 45 |
|
| 46 |
+
Input is JSONL with a `text` field per document. In Python:
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
import idealens as il
|
| 50 |
+
|
| 51 |
+
with il.Detector("ProseLens") as det: # vLLM, with this repo's thresholds
|
| 52 |
+
records = det.score_documents([open("document.txt").read()])
|
| 53 |
+
print(records[0]["p_human"], records[0]["verdict"]["ai"])
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
To compare with idea-level detection on the same documents, `idealens run docs.jsonl -o ideas.jsonl --model IdeaLens`
|
| 57 |
+
extracts their outlines and scores them with [IdeaLens](https://huggingface.co/rishanthrajendhran/IdeaLens). The rest
|
| 58 |
+
of this section runs the model directly.
|
| 59 |
|
| 60 |
### Load the merged model (66 GB download)
|
| 61 |
|