Spaces:
Sleeping
Sleeping
lukestanley
commited on
Commit
·
68a2a07
1
Parent(s):
e2b2995
Update comments and remove unused code
Browse files
chill.py
CHANGED
@@ -12,16 +12,12 @@ from promptObjects import (
|
|
12 |
SpicyScore,
|
13 |
)
|
14 |
|
15 |
-
# This script uses the llama_cpp server to improve a text.
|
16 |
-
# To run this script, you need to do something like this:
|
17 |
-
# Download the model: https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF/resolve/main/mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf?download=true
|
18 |
-
# Rename it as needed.
|
19 |
-
# Install the server and start it:
|
20 |
# pip install llama-cpp-python[server] --upgrade
|
21 |
# python3 -m llama_cpp.server --model mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --port 5834 --n_ctx 4096 --use_mlock false
|
22 |
# Run this script:
|
23 |
# python3 chill.py
|
24 |
-
# This
|
25 |
|
26 |
original_text = """Stop chasing dreams instead. Life is not a Hollywood movie. Not everyone is going to get a famous billionaire. Adjust your expectations to reality, and stop thinking so highly of yourself, stop judging others. Assume the responsibility for the things that happen in your life. It is kind of annoying to read your text, it is always some external thing that "happened" to you, and it is always other people who are not up to your standards. At some moment you even declare with despair. And guess what? This is true and false at the same time, in a fundamental level most people are not remarkable, and you probably aren't too. But at the same time, nobody is the same, you have worth just by being, and other people have too. The impression I get is that you must be someone incredibly annoying to work with, and that your performance is not even nearly close to what you think it is, and that you really need to come down to earth. Stop looking outside, work on yourself instead. You'll never be satisfied just by changing jobs. Do therapy if you wish, become acquainted with stoicism, be a volunteer in some poor country, whatever, but do something to regain control of your life, to get some perspective, and to adjust your expectations to reality."""
|
27 |
# From elzbardico on https://news.ycombinator.com/item?id=36119858
|
@@ -133,8 +129,7 @@ for iteration in range(1, max_iterations + 1):
|
|
133 |
print("ValueError:", e)
|
134 |
continue
|
135 |
|
136 |
-
# TODO: Segment the text into sentences for parallel processing,
|
137 |
-
# and isolate the most problematic parts for improvement
|
138 |
"""
|
139 |
# import pysbd
|
140 |
# sentences = pysbd.Segmenter(language="en", clean=False).segment(paragraph)
|
|
|
12 |
SpicyScore,
|
13 |
)
|
14 |
|
15 |
+
# This script uses the llama_cpp server to improve a text, it depends on the llama_cpp server being installed and running with a model loaded.
|
|
|
|
|
|
|
|
|
16 |
# pip install llama-cpp-python[server] --upgrade
|
17 |
# python3 -m llama_cpp.server --model mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --port 5834 --n_ctx 4096 --use_mlock false
|
18 |
# Run this script:
|
19 |
# python3 chill.py
|
20 |
+
# This should then try and improve the original text below:
|
21 |
|
22 |
original_text = """Stop chasing dreams instead. Life is not a Hollywood movie. Not everyone is going to get a famous billionaire. Adjust your expectations to reality, and stop thinking so highly of yourself, stop judging others. Assume the responsibility for the things that happen in your life. It is kind of annoying to read your text, it is always some external thing that "happened" to you, and it is always other people who are not up to your standards. At some moment you even declare with despair. And guess what? This is true and false at the same time, in a fundamental level most people are not remarkable, and you probably aren't too. But at the same time, nobody is the same, you have worth just by being, and other people have too. The impression I get is that you must be someone incredibly annoying to work with, and that your performance is not even nearly close to what you think it is, and that you really need to come down to earth. Stop looking outside, work on yourself instead. You'll never be satisfied just by changing jobs. Do therapy if you wish, become acquainted with stoicism, be a volunteer in some poor country, whatever, but do something to regain control of your life, to get some perspective, and to adjust your expectations to reality."""
|
23 |
# From elzbardico on https://news.ycombinator.com/item?id=36119858
|
|
|
129 |
print("ValueError:", e)
|
130 |
continue
|
131 |
|
132 |
+
# TODO: Segment the text into sentences for parallel processing, and isolate the most problematic parts for improvement
|
|
|
133 |
"""
|
134 |
# import pysbd
|
135 |
# sentences = pysbd.Segmenter(language="en", clean=False).segment(paragraph)
|