streamdown 0.32.0__py3-none-any.whl → 0.33.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 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 = False
164
+ self.last_line_empty = True
165
165
  self.is_pty = False
166
166
  self.is_exec = False
167
167
  self.maybe_prompt = False
@@ -1088,7 +1088,7 @@ def width_calc():
1088
1088
  def main():
1089
1089
  parser = ArgumentParser(
1090
1090
  formatter_class=argparse.RawDescriptionHelpFormatter, description=textwrap.dedent(f"""
1091
- Streamdown is a Streaming markdown renderer for modern terminals.
1091
+ Streamdown is a streaming markdown renderer for modern terminals.
1092
1092
  https://github.com/day50-dev/Streamdown
1093
1093
 
1094
1094
  paths:
@@ -1190,6 +1190,7 @@ def main():
1190
1190
  termios.tcsetattr(sys.stdin, termios.TCSADRAIN, state.terminal)
1191
1191
  logging.warning(f"Exception thrown: {type(ex)} {ex}")
1192
1192
  traceback.print_exc()
1193
+ state.exit = 1
1193
1194
 
1194
1195
  if os.isatty(sys.stdout.fileno()) and state.Clipboard and state.code_buffer_raw:
1195
1196
  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
+ >
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamdown
3
- Version: 0.32.0
3
+ Version: 0.33.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 made to be compatible with and consistently render the wide variety of markdown from various llms.
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 Streaming markdown renderer for modern terminals.
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,12 @@
1
+ streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ streamdown/qwen3.md,sha256=1e7ELkK-quwUeOmBDwXodFH-DlnfAcQWj32rjK6Zex4,542
3
+ streamdown/sd.py,sha256=jdMBN1iQ-L-t4h2yjETGS97s-6e50BEFv4C14ToS5AM,44961
4
+ streamdown/ss,sha256=sel_phpaecrw6WGIHRLROsD7BFShf0rSDHheflwdUn8,277
5
+ streamdown/ss1,sha256=CUVf86_2zeAle2oQCeTfWYqtHBrAFR_UgvptuYMQzFU,3151
6
+ streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
7
+ streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
8
+ streamdown-0.33.0.dist-info/METADATA,sha256=Xq6ccpX4MUuXKwXOAVWV09WXuqYdEpTj52-QRVQZB9E,10216
9
+ streamdown-0.33.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ streamdown-0.33.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
11
+ streamdown-0.33.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
12
+ streamdown-0.33.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,,