| 1 | <%# |
| 2 | Sidebar "Use this model" panel — clone/download snippets plus a |
| 3 | library-specific load example. Locals: repository, owner, card. |
| 4 | %> |
| 5 | <% full = "#{owner.username}/#{repository.name}" %> |
| 6 | <% lib = card.library_name.to_s.downcase %> |
| 7 | |
| 8 | <div class="card p-4"> |
| 9 | <h3 class="text-xs uppercase tracking-wider text-gray-500 font-semibold mb-3 flex items-center gap-1.5"> |
| 10 | <svg class="w-3.5 h-3.5" viewBox="0 0 16 16" fill="currentColor"><path d="M7.47 10.78a.75.75 0 0 0 1.06 0l3.75-3.75a.75.75 0 0 0-1.06-1.06L8.75 8.44V1.75a.75.75 0 0 0-1.5 0v6.69L4.78 5.97a.75.75 0 0 0-1.06 1.06ZM3.75 13a.75.75 0 0 0 0 1.5h8.5a.75.75 0 0 0 0-1.5Z"/></svg> |
| 11 | Use this model |
| 12 | </h3> |
| 13 | |
| 14 | <div class="code-container p-3 space-y-0.5 mb-3"> |
| 15 | <p class="text-gray-500"># Download with the siGit CLI</p> |
| 16 | <p class="text-gray-200">sigit download <%= full %></p> |
| 17 | </div> |
| 18 | |
| 19 | <div class="code-container p-3 space-y-0.5"> |
| 20 | <% if lib.include?("gguf") || card.tags.any? { |t| t.downcase.include?("gguf") } %> |
| 21 | <p class="text-gray-500"># Run with llama.cpp</p> |
| 22 | <p class="text-gray-200">llama-cli -hf <%= full %></p> |
| 23 | <% elsif lib.include?("transformers") || lib.empty? %> |
| 24 | <p class="text-gray-500"># Load with Transformers</p> |
| 25 | <p class="text-gray-200">from transformers import AutoModel</p> |
| 26 | <p class="text-gray-200">m = AutoModel.from_pretrained(</p> |
| 27 | <p class="text-gray-200"> "<%= full %>",</p> |
| 28 | <p class="text-gray-200"> revision="<%= repository.default_branch %>")</p> |
| 29 | <% else %> |
| 30 | <p class="text-gray-500"># Clone the repository</p> |
| 31 | <p class="text-gray-200">git clone https://sigit.si/<%= full %></p> |
| 32 | <% end %> |
| 33 | </div> |
| 34 | </div> |