Instructions to use TroyDoesAI/UncensoredLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TroyDoesAI/UncensoredLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TroyDoesAI/UncensoredLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TroyDoesAI/UncensoredLM") model = AutoModelForCausalLM.from_pretrained("TroyDoesAI/UncensoredLM") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TroyDoesAI/UncensoredLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TroyDoesAI/UncensoredLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TroyDoesAI/UncensoredLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TroyDoesAI/UncensoredLM
- SGLang
How to use TroyDoesAI/UncensoredLM 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 "TroyDoesAI/UncensoredLM" \ --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": "TroyDoesAI/UncensoredLM", "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 "TroyDoesAI/UncensoredLM" \ --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": "TroyDoesAI/UncensoredLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TroyDoesAI/UncensoredLM with Docker Model Runner:
docker model run hf.co/TroyDoesAI/UncensoredLM
Included prompt template and lazy editing of chat gpt putting my notes together paper for rough draft to mark it first. Using Blocks of perspectives and skills.
Browse files
README.md
CHANGED
|
@@ -13,4 +13,48 @@ My Goal as an AI Researcher is to make smarter models, and sometimes alignment a
|
|
| 13 |
|
| 14 |
Further testing on reasoning domains is required as it appears the model makes its best attempt at any task provided without any restraint.
|
| 15 |
|
| 16 |
-
Best, TroyDoesAI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
Further testing on reasoning domains is required as it appears the model makes its best attempt at any task provided without any restraint.
|
| 15 |
|
| 16 |
+
Best, TroyDoesAI
|
| 17 |
+
|
| 18 |
+
### Abstract
|
| 19 |
+
This paper presents a method for structuring training prompts in language models to enhance response relevance and contextual accuracy using the keyword `perspective`. This approach leverages `perspective` to guide the model in generating responses that reflect different viewpoints or interpretations of input queries.
|
| 20 |
+
|
| 21 |
+
### Introduction
|
| 22 |
+
Effective language models require precise mechanisms for generating contextually appropriate responses. The term `perspective` offers a multifaceted approach to frame responses, addressing both conceptual viewpoints and visual contexts. This research explores the use of `perspective` in prompt templates to direct model outputs according to specified contexts.
|
| 23 |
+
|
| 24 |
+
### Methodology
|
| 25 |
+
The proposed prompt template is:
|
| 26 |
+
```
|
| 27 |
+
"perspective,input,output": "<s> [INST] [%perspective%] %input% [/INST] [/perspective]: %output%</s>"
|
| 28 |
+
```
|
| 29 |
+
- **`[INST]` and `[/INST]`**: Wrap instructions for context.
|
| 30 |
+
- **`[%perspective%]`**: Placeholder for specifying the viewpoint or context.
|
| 31 |
+
- **`%input%`**: Represents the user's query.
|
| 32 |
+
- **`[/perspective]: %output%`**: Delineates the response section according to the given perspective.
|
| 33 |
+
|
| 34 |
+
### Definitions and Rationale
|
| 35 |
+
1. **Perspective** can refer to:
|
| 36 |
+
- **Viewpoint**: The angle or opinion from which something is considered.
|
| 37 |
+
- **Visible Scene**: The spatial or visual representation of a scene.
|
| 38 |
+
- **Spatial Representation**: In art, how objects are depicted to convey depth and distance.
|
| 39 |
+
|
| 40 |
+
By incorporating `perspective`, the model can frame responses to reflect various viewpoints, enhancing response relevance.
|
| 41 |
+
|
| 42 |
+
### Application
|
| 43 |
+
Incorporating `perspective` into training prompts ensures that responses are:
|
| 44 |
+
- **Contextually Relevant**: Aligning with the specified viewpoint.
|
| 45 |
+
- **Nuanced**: Addressing different angles and interpretations.
|
| 46 |
+
- **Consistent**: Providing uniform guidance for generating responses.
|
| 47 |
+
|
| 48 |
+
For example, querying "How does climate change affect coastal cities?" with a `perspective` keyword allows the model to generate responses from environmental, economic, or social viewpoints, thus enriching the answer's depth.
|
| 49 |
+
|
| 50 |
+
### Results and Benefits
|
| 51 |
+
Using `perspective` as a keyword in prompt templates leads to:
|
| 52 |
+
- Improved relevance and contextual accuracy of responses.
|
| 53 |
+
- Enhanced ability to address complex queries from multiple angles.
|
| 54 |
+
- Consistent response structure facilitating model training and application.
|
| 55 |
+
|
| 56 |
+
### Conclusion
|
| 57 |
+
Employing `perspective` in language model prompt templates effectively directs responses according to specified contexts, improving both relevance and clarity. This method provides a structured approach for generating nuanced and contextually accurate outputs.
|
| 58 |
+
|
| 59 |
+
### Keywords
|
| 60 |
+
Language model, perspective, prompt template, contextual accuracy, response relevance.
|