This file contains 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 torchao, torch nightly (or torch 2.5) and transformers | |
from transformers import AutoTokenizer, AutoModelForCausalLM, TorchAoConfig | |
from transformers import TextStreamer | |
import torch | |
from tqdm import tqdm | |
import os | |
os.environ["TOKENIZERS_PARALLELISM"] = "false" # To prevent long warnings :) | |
torch.set_float32_matmul_precision('high') |
This file contains 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 javafx.application.Platform; | |
import javafx.embed.swing.JFXPanel; | |
import javafx.scene.Group; | |
import javafx.scene.Scene; | |
import javax.swing.*; | |
/** | |
* A custom {@link java.applet.Applet Applet} that sets-up a JavaFX environment. | |
*/ |