streamdown 0.32.0__py3-none-any.whl → 0.34.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamdown/qwen3.md +25 -0
- streamdown/sd.py +13 -4
- streamdown/ss +1 -0
- streamdown/ss1 +42 -0
- streamdown/test.txt +1 -0
- {streamdown-0.32.0.dist-info → streamdown-0.34.0.dist-info}/METADATA +3 -3
- streamdown-0.34.0.dist-info/RECORD +13 -0
- streamdown-0.32.0.dist-info/RECORD +0 -9
- {streamdown-0.32.0.dist-info → streamdown-0.34.0.dist-info}/WHEEL +0 -0
- {streamdown-0.32.0.dist-info → streamdown-0.34.0.dist-info}/entry_points.txt +0 -0
- {streamdown-0.32.0.dist-info → streamdown-0.34.0.dist-info}/licenses/LICENSE.MIT +0 -0
streamdown/qwen3.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
### **3. Integration Strategy**
|
|
3
|
+
**Call Python from Bash for heavy tasks:**
|
|
4
|
+
```bash
|
|
5
|
+
# Bash calls Python for UUID generation
|
|
6
|
+
uuid=$(python3 -c "from uuid import uuid4; print(uuid4())")
|
|
7
|
+
|
|
8
|
+
# Bash calls Python for structured logging
|
|
9
|
+
python3 -c "
|
|
10
|
+
from log_utils import log_input
|
|
11
|
+
log_input('$(echo "$input" | sed 's/'\''/\\'\''/g')', '$pane_id')
|
|
12
|
+
"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Pass state between layers via env vars:**
|
|
16
|
+
```bash
|
|
17
|
+
# Bash sets env vars
|
|
18
|
+
export PANE_ID="$pane_id"
|
|
19
|
+
export CAPTURE="$capture"
|
|
20
|
+
|
|
21
|
+
# Python reads them
|
|
22
|
+
import os
|
|
23
|
+
pane_id = os.getenv("PANE_ID")
|
|
24
|
+
```
|
|
25
|
+
|
streamdown/sd.py
CHANGED
|
@@ -161,7 +161,7 @@ class ParseState:
|
|
|
161
161
|
self.buffer = b''
|
|
162
162
|
self.current_line = ''
|
|
163
163
|
self.first_line = True
|
|
164
|
-
self.last_line_empty =
|
|
164
|
+
self.last_line_empty = True
|
|
165
165
|
self.is_pty = False
|
|
166
166
|
self.is_exec = False
|
|
167
167
|
self.maybe_prompt = False
|
|
@@ -605,6 +605,7 @@ def parse(stream):
|
|
|
605
605
|
elif stream.fileno() in ready_in:
|
|
606
606
|
byte = os.read(stream.fileno(), 1)
|
|
607
607
|
TimeoutIx = 0
|
|
608
|
+
|
|
608
609
|
elif TimeoutIx == 0:
|
|
609
610
|
# This is our record separator for debugging - hands peaking
|
|
610
611
|
debug_write("🫣".encode('utf-8'))
|
|
@@ -614,7 +615,13 @@ def parse(stream):
|
|
|
614
615
|
byte = stream.read(1)
|
|
615
616
|
|
|
616
617
|
if byte is not None:
|
|
617
|
-
|
|
618
|
+
# This is the eol
|
|
619
|
+
if byte == b'':
|
|
620
|
+
if len(state.buffer) == 0:
|
|
621
|
+
break
|
|
622
|
+
else:
|
|
623
|
+
byte = b'\n'
|
|
624
|
+
|
|
618
625
|
state.buffer += byte
|
|
619
626
|
debug_write(byte)
|
|
620
627
|
|
|
@@ -622,6 +629,7 @@ def parse(stream):
|
|
|
622
629
|
|
|
623
630
|
line = state.buffer.decode('utf-8').replace('\t',' ')
|
|
624
631
|
state.has_newline = line.endswith('\n')
|
|
632
|
+
|
|
625
633
|
# I hate this. There should be better ways.
|
|
626
634
|
state.maybe_prompt = not state.has_newline and state.current()['none'] and re.match(r'^.*>\s+$', visible(line))
|
|
627
635
|
|
|
@@ -666,7 +674,7 @@ def parse(stream):
|
|
|
666
674
|
yield FGRESET
|
|
667
675
|
state.block_depth = 0
|
|
668
676
|
|
|
669
|
-
#
|
|
677
|
+
# Collapse Multiple Empty Lines if not in code blocks
|
|
670
678
|
if not state.in_code:
|
|
671
679
|
is_empty = line.strip() == ""
|
|
672
680
|
|
|
@@ -1088,7 +1096,7 @@ def width_calc():
|
|
|
1088
1096
|
def main():
|
|
1089
1097
|
parser = ArgumentParser(
|
|
1090
1098
|
formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent(f"""
|
|
1091
|
-
Streamdown is a
|
|
1099
|
+
Streamdown is a streaming markdown renderer for modern terminals.
|
|
1092
1100
|
https://github.com/day50-dev/Streamdown
|
|
1093
1101
|
|
|
1094
1102
|
paths:
|
|
@@ -1190,6 +1198,7 @@ def main():
|
|
|
1190
1198
|
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, state.terminal)
|
|
1191
1199
|
logging.warning(f"Exception thrown: {type(ex)} {ex}")
|
|
1192
1200
|
traceback.print_exc()
|
|
1201
|
+
state.exit = 1
|
|
1193
1202
|
|
|
1194
1203
|
if os.isatty(sys.stdout.fileno()) and state.Clipboard and state.code_buffer_raw:
|
|
1195
1204
|
code = state.code_buffer_raw
|
streamdown/ss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* **Model Card:** Always read the model card on the Hugging Face Hub ([https://huggingface.co/microsoft/bitnet-b1.58-2B-4T](https://huggingface.co/microsoft/bitnet-b1.58-2B-4T)) for important information about the model, its intended use, limitations, and potential biases.
|
streamdown/ss1
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
* `model.safetensors`: The name of the file you want to download. You'll need to know the exact filename. You can find the files in the model repository on the Hugging Face Hub website ([https://huggingface.co/microsoft/bitnet-b1.58-2B-4T](https://huggingface.co/microsoft/bitnet-b1.58-2B-4T)). Look under the "Files and versions" tab. `safetensors` is the preferred format for model weights now. If it's a `.bin` file, you can download that instead.
|
|
2
|
+
* `--local-dir ./bitnet-b1.58-2B-4T`: The directory to save the file to.
|
|
3
|
+
|
|
4
|
+
* **Download using `transformers` library (recommended for most use cases):**
|
|
5
|
+
|
|
6
|
+
The `transformers` library provides a convenient way to download and cache models. This is often the easiest approach if you're using the model with `transformers`. You don't *directly* use the `huggingface-cli` for this, but it's worth knowing.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
10
|
+
|
|
11
|
+
model_name = "microsoft/bitnet-b1.58-2B-4T"
|
|
12
|
+
|
|
13
|
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
14
|
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
15
|
+
|
|
16
|
+
# The model and tokenizer will be downloaded and cached in your
|
|
17
|
+
# transformers cache directory (usually ~/.cache/huggingface/transformers).
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
This approach automatically handles downloading the necessary files and caching them for future use. It also handles the correct file formats and configurations.
|
|
21
|
+
|
|
22
|
+
**4. Checking the Download**
|
|
23
|
+
|
|
24
|
+
After the download completes, verify that the files are in the specified directory. You can use `ls` (Linux/macOS) or `dir` (Windows) to list the contents of the directory.
|
|
25
|
+
|
|
26
|
+
**Important Considerations:**
|
|
27
|
+
|
|
28
|
+
* **Disk Space:** The `bitnet-b1.58-2B-4T` model is quite large (several gigabytes). Make sure you have enough free disk space before downloading.
|
|
29
|
+
* **Network Connection:** A stable and fast internet connection is essential for a smooth download.
|
|
30
|
+
* **Caching:** The Hugging Face Hub and `transformers` library use caching to avoid re-downloading models unnecessarily. The default cache directory is usually `~/.cache/huggingface/transformers`.
|
|
31
|
+
* **File Formats:** Models are often stored in `safetensors` or `.bin` formats. `safetensors` is generally preferred for security and performance.
|
|
32
|
+
* **Model Card:** Always read the model card on the Hugging Face Hub ([https://huggingface.co/microsoft/bitnet-b1.58-2B-4T](https://huggingface.co/microsoft/bitnet-b1.58-2B-4T)) for important information about the model, its intended use, limitations, and potential biases.
|
|
33
|
+
* **Gated Models:** Some models require you to accept terms of use before you can download them. The `huggingface-cli login` command will guide you through this process if necessary.
|
|
34
|
+
|
|
35
|
+
**Example Workflow (Recommended):**
|
|
36
|
+
|
|
37
|
+
1. `huggingface-cli login` (if not already logged in)
|
|
38
|
+
2. Use the `transformers` library in a Python script to download and load the model (as shown in the example above). This is the most convenient and reliable method for most use cases.
|
|
39
|
+
|
|
40
|
+
Let me know if you have any other questions or if you'd like help with a specific task related to this model!
|
|
41
|
+
|
|
42
|
+
>
|
streamdown/test.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hi
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamdown
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.34.0
|
|
4
4
|
Summary: A streaming markdown renderer for modern terminals with syntax highlighting
|
|
5
5
|
Project-URL: Homepage, https://github.com/day50-dev/Streamdown
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/day50-dev/Streamdown/issues
|
|
@@ -39,7 +39,7 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
|
|
40
40
|
Streamdown works with any streaming markdown such as [simonw's llm](https://github.com/simonw/llm) or even something basic like curl.
|
|
41
41
|
|
|
42
|
-
It's
|
|
42
|
+
It's designed for compatibility with the wide variety of markdown from various LLM models.
|
|
43
43
|
|
|
44
44
|
It supports standard piping and files as arguments like any normal pager but can also run as a wrapper so you retain full keyboard interactivity. Arrow keys, control, alt, all still work.
|
|
45
45
|
```bash
|
|
@@ -168,7 +168,7 @@ To override the margin.
|
|
|
168
168
|
usage: sd [-h] [-l LOGLEVEL] [-b BASE] [-c CONFIG] [-w WIDTH] [-e EXEC]
|
|
169
169
|
[-s SCRAPE] [filenameList ...]
|
|
170
170
|
|
|
171
|
-
Streamdown is a
|
|
171
|
+
Streamdown is a streaming markdown renderer for modern terminals.
|
|
172
172
|
https://github.com/day50-dev/Streamdown
|
|
173
173
|
|
|
174
174
|
paths:
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
streamdown/qwen3.md,sha256=1e7ELkK-quwUeOmBDwXodFH-DlnfAcQWj32rjK6Zex4,542
|
|
3
|
+
streamdown/sd.py,sha256=zN3UlFR7v1iZkJSuu_SS5ie9Wurwcd_5ZUTaiwbziQQ,45105
|
|
4
|
+
streamdown/ss,sha256=sel_phpaecrw6WGIHRLROsD7BFShf0rSDHheflwdUn8,277
|
|
5
|
+
streamdown/ss1,sha256=CUVf86_2zeAle2oQCeTfWYqtHBrAFR_UgvptuYMQzFU,3151
|
|
6
|
+
streamdown/test.txt,sha256=j0NDRmSPa5bfid2pAcUXaxCm2Dlh3TwayItZstwyeqQ,2
|
|
7
|
+
streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
|
|
8
|
+
streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
|
|
9
|
+
streamdown-0.34.0.dist-info/METADATA,sha256=0PwXjpsC4UNnlwe7QVIpQwv5jiszUq0xBFqlNlYMGFg,10216
|
|
10
|
+
streamdown-0.34.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
streamdown-0.34.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
|
|
12
|
+
streamdown-0.34.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
|
|
13
|
+
streamdown-0.34.0.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
streamdown/sd.py,sha256=A_ffjDqSJAe_5NSX1J34CsjTQaEO--a5_9Vnbrs9YoM,44939
|
|
3
|
-
streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
|
|
4
|
-
streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
|
|
5
|
-
streamdown-0.32.0.dist-info/METADATA,sha256=XrM7tUioApWJVEuRnK-lzX3a3VU83-wrGBEKXE2lFEQ,10229
|
|
6
|
-
streamdown-0.32.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
-
streamdown-0.32.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
|
|
8
|
-
streamdown-0.32.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
|
|
9
|
-
streamdown-0.32.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|