Spaces:
Sleeping
Sleeping
lukestanley
commited on
Commit
•
21ce4d4
1
Parent(s):
9f20b49
Documentation changes
Browse files
README.md
CHANGED
@@ -9,7 +9,7 @@ pinned: false
|
|
9 |
# ❄️ ChillTranslator 🤬 ➡️ 😎💬
|
10 |
|
11 |
|
12 |
-
This is an early experimental tool aimed at
|
13 |
|
14 |
|
15 |
ChillTranslator aims to help make online interactions more healthy.
|
@@ -21,36 +21,37 @@ Online toxicity can undermine the quality of discourse, causing distress 😞 an
|
|
21 |
<img src="https://github.com/lukestanley/ChillTranslator/assets/306671/2899f311-24ee-4ce4-ba76-d1de665aab01" width="300">
|
22 |
|
23 |
ChillTranslator hopes to mitigate toxic comments by automatically rephrasing negative comments, while maintaining the original intent and promoting positive communication 🗣️➡️💬. These rephrased texts could be suggested to the original authors as alternatives, or users could enhance their internet experience with "rose-tinted glasses" 🌹😎, automatically translating spicy comments into versions that are easier and more calming to read.
|
24 |
-
There could be all kinds of failure cases, but it's a start!
|
25 |
|
26 |
Could Reddit, Twitter, Hacker News, or even YouTube comments be more calm and constructive places? I think so!
|
27 |
|
28 |
![ChillTranslator demo](https://github.com/lukestanley/ChillTranslator/assets/306671/128611f4-3e8e-4c52-ba20-2ae61d727d52)
|
29 |
|
30 |
|
31 |
-
You can try out the ChillTranslator
|
32 |
|
33 |
-
##
|
34 |
-
|
35 |
-
- **
|
36 |
-
- **
|
37 |
-
- **Offline LLM model**: running DIY could save costs, avoid needing to sign up to APIs, and avoid the risk of toxic content causing API access to be revoked. We use llama-cpp-python's server with Mixtral.
|
38 |
-
|
39 |
-
- **HuggingFace Space**: A demo is now available at HuggingFace Spaces, allowing users to try out ChillTranslator without any setup.
|
40 |
|
41 |
## Possible future directions 🌟
|
42 |
- **Integration**: example showing use as Python module, HTTP API, for use from other tools, browser extensions.
|
43 |
- **Speed** improvements.
|
|
|
|
|
44 |
- Split text into sentences e.g: with “pysbd” for parallel processing of translations.
|
45 |
-
-
|
46 |
-
- Use a dataset of hate speech to make a dataset for training a translation transformer like Google's T5 to run faster than Mixtral could.
|
47 |
- Use natural language similarity techniques to compare possible rephrasing fidelity faster.
|
48 |
- Enabling easy experimenting with online hosted LLM APIs
|
49 |
-
-
|
|
|
|
|
|
|
50 |
|
51 |
-
## Getting
|
52 |
|
53 |
-
### Try it
|
54 |
|
55 |
You can try out ChillTranslator without any installation by visiting the HuggingFace Space demo:
|
56 |
```
|
@@ -64,10 +65,7 @@ https://huggingface.co/spaces/lukestanley/ChillTranslator
|
|
64 |
git clone https://github.com/lukestanley/ChillTranslator.git
|
65 |
cd ChillTranslator
|
66 |
```
|
67 |
-
2.
|
68 |
-
```
|
69 |
-
wget https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF/resolve/main/mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf?download=true -O mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf &
|
70 |
-
```
|
71 |
3. Install dependencies, including a special fork of `llama-cpp-python`, and Nvidia GPU support if needed:
|
72 |
```
|
73 |
pip install requests pydantic uvicorn starlette fastapi sse_starlette starlette_context pydantic_settings
|
@@ -81,7 +79,7 @@ https://huggingface.co/spaces/lukestanley/ChillTranslator
|
|
81 |
```
|
82 |
python3 -m llama_cpp.server --model mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --port 5834 --n_ctx 4096 --use_mlock false --n_gpu_layers 20 &
|
83 |
```
|
84 |
-
These config options
|
85 |
|
86 |
|
87 |
### Local Usage
|
|
|
9 |
# ❄️ ChillTranslator 🤬 ➡️ 😎💬
|
10 |
|
11 |
|
12 |
+
This is an early experimental tool aimed at helping reduce online toxicity by automatically ➡️ transforming 🌶️ spicy or toxic comments into constructive, ❤️ kinder dialogues using AI and large language models.
|
13 |
|
14 |
|
15 |
ChillTranslator aims to help make online interactions more healthy.
|
|
|
21 |
<img src="https://github.com/lukestanley/ChillTranslator/assets/306671/2899f311-24ee-4ce4-ba76-d1de665aab01" width="300">
|
22 |
|
23 |
ChillTranslator hopes to mitigate toxic comments by automatically rephrasing negative comments, while maintaining the original intent and promoting positive communication 🗣️➡️💬. These rephrased texts could be suggested to the original authors as alternatives, or users could enhance their internet experience with "rose-tinted glasses" 🌹😎, automatically translating spicy comments into versions that are easier and more calming to read.
|
24 |
+
There could be all kinds of failure cases, but hey, it's a start!
|
25 |
|
26 |
Could Reddit, Twitter, Hacker News, or even YouTube comments be more calm and constructive places? I think so!
|
27 |
|
28 |
![ChillTranslator demo](https://github.com/lukestanley/ChillTranslator/assets/306671/128611f4-3e8e-4c52-ba20-2ae61d727d52)
|
29 |
|
30 |
|
31 |
+
You can try out the ChillTranslator via the HuggingFace Space demo at [https://huggingface.co/spaces/lukestanley/ChillTranslator](https://huggingface.co/spaces/lukestanley/ChillTranslator).
|
32 |
|
33 |
+
## Aims to:
|
34 |
+
- **Convert** text to less toxic variations
|
35 |
+
- **Preserve original intent**, focusing on constructive dialogue
|
36 |
+
- **Self-hostable, serverless, or APIs**: running DIY could save costs, avoid needing to sign up to APIs, and avoid the risk of toxic content causing API access to be revoked. We use llama-cpp-python with Mixtral, with a HTTP server option, and a fast "serverless" backend using RunPod currently.
|
|
|
|
|
|
|
37 |
|
38 |
## Possible future directions 🌟
|
39 |
- **Integration**: example showing use as Python module, HTTP API, for use from other tools, browser extensions.
|
40 |
- **Speed** improvements.
|
41 |
+
- Generating rephrasings in parallel.
|
42 |
+
- Use Jigsaw dataset to find spicy comments, making a dataset for training a translation transformer, maybe like Google's T5 to run faster than Mixtral could.
|
43 |
- Split text into sentences e.g: with “pysbd” for parallel processing of translations.
|
44 |
+
- Try using a 'Detoxify' scoring model instead of the current "spicy" score method.
|
|
|
45 |
- Use natural language similarity techniques to compare possible rephrasing fidelity faster.
|
46 |
- Enabling easy experimenting with online hosted LLM APIs
|
47 |
+
- Making setup on different platforms easier
|
48 |
+
- **Quality** improvements.
|
49 |
+
- Collecting a dataset of spicy comments and their rephrasings.
|
50 |
+
- Feedback loop: users could score rephrasings, or suggest their own.
|
51 |
|
52 |
+
## Getting started 🚀
|
53 |
|
54 |
+
### Try it online
|
55 |
|
56 |
You can try out ChillTranslator without any installation by visiting the HuggingFace Space demo:
|
57 |
```
|
|
|
65 |
git clone https://github.com/lukestanley/ChillTranslator.git
|
66 |
cd ChillTranslator
|
67 |
```
|
68 |
+
2. It will automaticaly download [Mixtral-8x7B-Instruct-v0.1-GGUF](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF/resolve/main/mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf?download=true) by default. The model HuggingFace repo and filename can be switched by enviroment variables, or you can point to a different local path.
|
|
|
|
|
|
|
69 |
3. Install dependencies, including a special fork of `llama-cpp-python`, and Nvidia GPU support if needed:
|
70 |
```
|
71 |
pip install requests pydantic uvicorn starlette fastapi sse_starlette starlette_context pydantic_settings
|
|
|
79 |
```
|
80 |
python3 -m llama_cpp.server --model mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --port 5834 --n_ctx 4096 --use_mlock false --n_gpu_layers 20 &
|
81 |
```
|
82 |
+
These config options are likely to need tweaking. Please check out https://llama-cpp-python.readthedocs.io/en/latest/ for more info.
|
83 |
|
84 |
|
85 |
### Local Usage
|
app.py
CHANGED
@@ -48,9 +48,9 @@ examples = [
|
|
48 |
description = """
|
49 |
# ❄️ ChillTranslator 🤬 ➡️ 😎💬
|
50 |
|
51 |
-
This is an early experimental tool aimed at
|
52 |
|
53 |
-
ChillTranslator aims to help make online interactions more healthy and is now available
|
54 |
|
55 |
- **Converts** text to less toxic variations
|
56 |
- **Preserves original intent**, focusing on constructive dialogue
|
@@ -58,7 +58,18 @@ ChillTranslator aims to help make online interactions more healthy and is now av
|
|
58 |
Try out the ChillTranslator here, or check out the project on GitHub:
|
59 |
[https://github.com/lukestanley/ChillTranslator](https://github.com/lukestanley/ChillTranslator)
|
60 |
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
"""
|
63 |
|
64 |
demo = gr.Interface(
|
|
|
48 |
description = """
|
49 |
# ❄️ ChillTranslator 🤬 ➡️ 😎💬
|
50 |
|
51 |
+
This is an early experimental tool aimed at helping reduce online toxicity by automatically ➡️ transforming 🌶️ spicy or toxic comments into constructive, ❤️ kinder dialogues using AI and large language models.
|
52 |
|
53 |
+
ChillTranslator aims to help make online interactions more healthy and is now available to try directly below.
|
54 |
|
55 |
- **Converts** text to less toxic variations
|
56 |
- **Preserves original intent**, focusing on constructive dialogue
|
|
|
58 |
Try out the ChillTranslator here, or check out the project on GitHub:
|
59 |
[https://github.com/lukestanley/ChillTranslator](https://github.com/lukestanley/ChillTranslator)
|
60 |
|
61 |
+
## Contributing 🤝
|
62 |
+
|
63 |
+
Contributions are very welcome!
|
64 |
+
Especially:
|
65 |
+
- pull requests,
|
66 |
+
- free GPU credits
|
67 |
+
- LLM API credits / access.
|
68 |
+
|
69 |
+
ChillTranslator is released under the MIT License.
|
70 |
+
|
71 |
+
Help make the internet a kinder place, one comment at a time.
|
72 |
+
Your contribution could make a big difference!
|
73 |
"""
|
74 |
|
75 |
demo = gr.Interface(
|