Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need a copy code widget to be able to copy code snippets #2288

Open
stas00 opened this issue Oct 4, 2024 · 3 comments
Open

need a copy code widget to be able to copy code snippets #2288

stas00 opened this issue Oct 4, 2024 · 3 comments
Assignees
Labels
Documentation Improvements or additions to documentation feature request New feature or request not a bug Some known limitation, but not a bug. stale triaged Issue has been triaged by maintainers

Comments

@stas00
Copy link

stas00 commented Oct 4, 2024

Is it possible to add to https://nvidia.github.io/TensorRT-LLM/ the code copy widget that you already have on https://nvidia.github.io/TensorRT-Model-Optimizer/?
For example if you go to https://nvidia.github.io/TensorRT-Model-Optimizer/guides/_pytorch_quantization.html#apply-post-training-quantization-ptq you can copy the code

Image

But if you go to https://nvidia.github.io/TensorRT-LLM/llm-api-examples/index.html#llm-examples-introduction you can't - manual copy-n-paste results in double new lines for me.

Image

Thank you!

I think it's the way the HTML is encoded which breaks each line, because you have 2 spans per line

<span class="linenos"> 2</span>
<span class="linenos"> 3</span><span class="n">prompts</span> <span class="o">=</span> <span class="p">[</span>
<span class="linenos"> 4</span>    <span class="s2">&quot;Hello, my name is&quot;</span><span class="p">,</span>
<span class="linenos"> 5</span>    <span class="s2">&quot;The president of the United States is&quot;</span><span class="p">,</span>
<span class="linenos"> 6</span>    <span class="s2">&quot;The capital of France is&quot;</span><span class="p">,</span>
<span class="linenos"> 7</span>    <span class="s2">&quot;The future of AI is&quot;</span><span class="p">,</span>
<span class="linenos"> 8</span><span class="p">]</span>
@Superjomn Superjomn added Documentation Improvements or additions to documentation feature request New feature or request not a bug Some known limitation, but not a bug. triaged Issue has been triaged by maintainers labels Oct 15, 2024
@nv-guomingz nv-guomingz self-assigned this Oct 15, 2024
@nv-guomingz
Copy link
Collaborator

Hi @stas00 , thanks for remining us on this missing feature.
We'll enable the copy button on next release and Tensor Tuesday(weekly release)

@stas00
Copy link
Author

stas00 commented Oct 15, 2024

Thank you, @nv-guomingz!

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 15 days."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation feature request New feature or request not a bug Some known limitation, but not a bug. stale triaged Issue has been triaged by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants