Instructions to use wingchiuloong/CopyPasteLLM-L3-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wingchiuloong/CopyPasteLLM-L3-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wingchiuloong/CopyPasteLLM-L3-8B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("wingchiuloong/CopyPasteLLM-L3-8B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use wingchiuloong/CopyPasteLLM-L3-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wingchiuloong/CopyPasteLLM-L3-8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wingchiuloong/CopyPasteLLM-L3-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/wingchiuloong/CopyPasteLLM-L3-8B
- SGLang
How to use wingchiuloong/CopyPasteLLM-L3-8B 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 "wingchiuloong/CopyPasteLLM-L3-8B" \ --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": "wingchiuloong/CopyPasteLLM-L3-8B", "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 "wingchiuloong/CopyPasteLLM-L3-8B" \ --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": "wingchiuloong/CopyPasteLLM-L3-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use wingchiuloong/CopyPasteLLM-L3-8B with Docker Model Runner:
docker model run hf.co/wingchiuloong/CopyPasteLLM-L3-8B
Enhance model card: Add pipeline tag, library, paper, GitHub, and citation
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,19 +1,24 @@
|
|
| 1 |
---
|
| 2 |
-
license: llama3
|
| 3 |
base_model: meta-llama/Meta-Llama-3-8B-Instruct
|
| 4 |
-
tags:
|
| 5 |
-
- RAG hallucinations
|
| 6 |
-
- Knowledge Conflict
|
| 7 |
datasets:
|
| 8 |
- qiaojin/PubMedQA
|
| 9 |
- Salesforce/FaithEval-counterfactual-v1.0
|
| 10 |
- wandb/RAGTruth-processed
|
|
|
|
| 11 |
metrics:
|
| 12 |
- accuracy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
# CopyPasteLLM-L3-8B
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
## Quick Start
|
| 18 |
|
| 19 |
### Method 1: Using Transformers
|
|
@@ -99,7 +104,9 @@ def main():
|
|
| 99 |
# Set test question
|
| 100 |
context = "Galileo Galilei, renowned as one of the most influential figures in the history of science, made numerous contributions that revolutionized our understanding of physics and astronomy. His meticulous work with telescopes led to groundbreaking discoveries about the moons of Jupiter and the phases of Venus. Beyond the realm of astronomy, his observations and experiments laid the foundation for classical mechanics. One of Galileo’s lesser-known achievements is his development of the Three Laws of Motion, which were critical in advancing the study of kinematics and dynamics. These laws articulate the principles of inertia, the relationship between force and motion, and the law of action and reaction, providing a comprehensive framework for understanding moving bodies. His work on pendulums also contributed substantially to timekeeping and horology, as he discovered that pendulums of different lengths oscillate at predictable periods, a principle still applied in modern clocks. Galileo’s interdisciplinary approach enabled him to synthesize knowledge from various fields, which allowed new theories to emerge, reshaping the scientific landscape of his time and beyond. Notably, his support of the heliocentric model of the solar system earned him both acclaim and censure, highlighting the tension between scientific inquiry and established doctrine. In contrast to Galen’s biological studies and Newton’s later contributions, Galileo’s articulation of the Three Laws of Motion was pivotal in the transition from Aristotelian physics to Newtonian mechanics. His contributions remain a testament to the interplay of observation, theory, and experimentation in scientific progress."
|
| 101 |
question = "Which law was Galileo Galilei responsible for describing?"
|
| 102 |
-
test_question = f"{context}
|
|
|
|
|
|
|
| 103 |
print(f"{test_question}")
|
| 104 |
print("-" * 50)
|
| 105 |
|
|
@@ -131,7 +138,9 @@ def main():
|
|
| 131 |
|
| 132 |
# Output result
|
| 133 |
response = outputs[0]['generated_text']
|
| 134 |
-
print(f"
|
|
|
|
|
|
|
| 135 |
|
| 136 |
except Exception as e:
|
| 137 |
print(f"Inference failed: {e}")
|
|
@@ -165,7 +174,15 @@ python -m vllm.entrypoints.openai.api_server \
|
|
| 165 |
If you use this model in your research, please cite:
|
| 166 |
|
| 167 |
```bibtex
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
```
|
| 170 |
|
| 171 |
## License
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: meta-llama/Meta-Llama-3-8B-Instruct
|
|
|
|
|
|
|
|
|
|
| 3 |
datasets:
|
| 4 |
- qiaojin/PubMedQA
|
| 5 |
- Salesforce/FaithEval-counterfactual-v1.0
|
| 6 |
- wandb/RAGTruth-processed
|
| 7 |
+
license: llama3
|
| 8 |
metrics:
|
| 9 |
- accuracy
|
| 10 |
+
tags:
|
| 11 |
+
- RAG hallucinations
|
| 12 |
+
- Knowledge Conflict
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
library_name: transformers
|
| 15 |
---
|
| 16 |
|
| 17 |
# CopyPasteLLM-L3-8B
|
| 18 |
|
| 19 |
+
This model was presented in the paper [Copy-Paste to Mitigate Large Language Model Hallucinations](https://huggingface.co/papers/2510.00508).
|
| 20 |
+
Code: [https://github.com/longyongchao/CopyPasteLLM](https://github.com/longyongchao/CopyPasteLLM)
|
| 21 |
+
|
| 22 |
## Quick Start
|
| 23 |
|
| 24 |
### Method 1: Using Transformers
|
|
|
|
| 104 |
# Set test question
|
| 105 |
context = "Galileo Galilei, renowned as one of the most influential figures in the history of science, made numerous contributions that revolutionized our understanding of physics and astronomy. His meticulous work with telescopes led to groundbreaking discoveries about the moons of Jupiter and the phases of Venus. Beyond the realm of astronomy, his observations and experiments laid the foundation for classical mechanics. One of Galileo’s lesser-known achievements is his development of the Three Laws of Motion, which were critical in advancing the study of kinematics and dynamics. These laws articulate the principles of inertia, the relationship between force and motion, and the law of action and reaction, providing a comprehensive framework for understanding moving bodies. His work on pendulums also contributed substantially to timekeeping and horology, as he discovered that pendulums of different lengths oscillate at predictable periods, a principle still applied in modern clocks. Galileo’s interdisciplinary approach enabled him to synthesize knowledge from various fields, which allowed new theories to emerge, reshaping the scientific landscape of his time and beyond. Notably, his support of the heliocentric model of the solar system earned him both acclaim and censure, highlighting the tension between scientific inquiry and established doctrine. In contrast to Galen’s biological studies and Newton’s later contributions, Galileo’s articulation of the Three Laws of Motion was pivotal in the transition from Aristotelian physics to Newtonian mechanics. His contributions remain a testament to the interplay of observation, theory, and experimentation in scientific progress."
|
| 106 |
question = "Which law was Galileo Galilei responsible for describing?"
|
| 107 |
+
test_question = f"{context}
|
| 108 |
+
Q: {question}
|
| 109 |
+
A:"
|
| 110 |
print(f"{test_question}")
|
| 111 |
print("-" * 50)
|
| 112 |
|
|
|
|
| 138 |
|
| 139 |
# Output result
|
| 140 |
response = outputs[0]['generated_text']
|
| 141 |
+
print(f"
|
| 142 |
+
CopyPasteLLM:
|
| 143 |
+
{response}") # According to the passage, Galileo Galilei was responsible for describing the Three Laws of Motion, which articulate the principles of inertia, the relationship between force and motion, and the law of action and reaction.
|
| 144 |
|
| 145 |
except Exception as e:
|
| 146 |
print(f"Inference failed: {e}")
|
|
|
|
| 174 |
If you use this model in your research, please cite:
|
| 175 |
|
| 176 |
```bibtex
|
| 177 |
+
@misc{long2025copypastemitigatelargelanguage,
|
| 178 |
+
title={Copy-Paste to Mitigate Large Language Model Hallucinations},
|
| 179 |
+
author={Yongchao Long and Xian Wu and Yingying Zhang and Xianbin Wen and Yuxi Zhou and Shenda Hong},
|
| 180 |
+
year={2025},
|
| 181 |
+
eprint={2510.00508},
|
| 182 |
+
archivePrefix={arXiv},
|
| 183 |
+
primaryClass={cs.CL},
|
| 184 |
+
url={https://arxiv.org/abs/2510.00508},
|
| 185 |
+
}
|
| 186 |
```
|
| 187 |
|
| 188 |
## License
|