- source:
HF Model Metadata - author:
Sugato Ray@sugatoray
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## install: | |
| ## > pip install schedule watchfiles | |
| import os | |
| import time | |
| from datetime import datetime | |
| import schedule | |
| import stat | |
| from watchfiles import watch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub InsertAllSlides() | |
| ' Insert all slides from all presentations in the same folder as this one | |
| ' INTO this one; do not attempt to insert THIS file into itself, though. | |
| Dim vArray() As String | |
| Dim x As Long | |
| ' Change "*.PPT" to "*.PPTX" or whatever if necessary: | |
| EnumerateFiles ActivePresentation.Path & "\", "*.PPTX", vArray |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Custom CSS for Marimo - Font customization */ | |
| /* Import Press Start 2P font from Google Fonts */ | |
| @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap'); | |
| :root { | |
| --marimo-monospace-font: 'Press Start 2P', 'Courier New', monospace; | |
| --marimo-text-font: 'Press Start 2P', 'Courier New', monospace; | |
| --marimo-heading-font: 'Press Start 2P', 'Courier New', monospace; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --- Configuration --- | |
| $sourcePath = "C:\Path\To\Your\SourcePpts" # Folder containing the PPTs to merge | |
| $outputPath = "C:\Path\To\Your\MergedPresentation.pptx" # Full path for the merged output file | |
| # Get a list of PowerPoint files to merge (e.g., all .pptx files) | |
| $pptFiles = Get-ChildItem -Path $sourcePath -Filter "*.pptx" | Sort-Object Name | |
| # --- Check if there are files to merge --- | |
| if ($pptFiles.Count -eq 0) { | |
| Write-Host "No PowerPoint files found in: $sourcePath" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import torch | |
| import psutil | |
| import datasets | |
| import glob | |
| from transformers import ( | |
| AutoTokenizer, LlamaConfig, LlamaForCausalLM, Trainer, TrainingArguments, | |
| DataCollatorForLanguageModeling | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.11,<3.12" | |
| # dependencies = [ | |
| # "distilabel[mlx]", | |
| # ] | |
| # /// | |
| from distilabel.models import MlxLLM | |
| from distilabel.pipeline import InstructionResponsePipeline | |
| llm = MlxLLM( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.11,<3.12" | |
| # dependencies = [ | |
| # "distilabel[hf-transformers, hf-inference-endpoints]", | |
| # ] | |
| # /// | |
| from distilabel.models import InferenceEndpointsLLM | |
| from distilabel.pipeline import InstructionResponsePipeline | |
| repo_id = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # requires sentence_transformers>=3.2.0 | |
| from sentence_transformers import SentenceTransformer, export_optimized_onnx_model, export_dynamic_quantized_onnx_model | |
| # The model to export to ONNX (+ optimize, quantize), OpenVINO | |
| model_id = "mixedbread-ai/mxbai-embed-large-v1" | |
| # Where to save the exported models locally | |
| output_dir = model_id.replace("/", "-") | |
| onnx_model = SentenceTransformer(model_id, backend="onnx", model_kwargs={"export": True}) | |
| onnx_model.save_pretrained(output_dir) |
NewerOlder
