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
# based on StableLM chat | |
# https://huggingface.co/spaces/stabilityai/stablelm-tuned-alpha-chat | |
import gradio as gr | |
import torch | |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, StoppingCriteria, StoppingCriteriaList, TextIteratorStreamer | |
import time | |
import numpy as np | |
from torch.nn import functional as F | |
import os | |
from threading import Thread |
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 java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.util.stream.IntStream; | |
import javax.swing.*; | |
public class ParticleParallel { | |
enum Type{ | |
WATER(new Color(0, 0, 255, 96)), OUTWALL(Color.BLACK), INWALL(Color.GREEN); |
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 java.awt.*; | |
import java.awt.geom.Path2D; | |
import java.awt.image.BufferedImage; | |
import javax.swing.*; | |
public class WaveAnim { | |
public static void main(String[] args){ | |
final int TDIV = 1000; //時間の分割数 | |
final int XDIV = 40; //座標の分割数 | |
final int VIEWSTEP = 25;//何コマごとに描画するか |
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
# Dependencies: transformers, colorama, torch, matplotlib, numpy | |
# pip install transformers colorama torch matplotlib numpy | |
# Models are stored at C:\Users\%username%\.cache\huggingface\hub | |
import time | |
import random | |
import torch | |
import array | |
import numpy as np | |
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline, Conversation, set_seed | |
from colorama import Fore, Back, Style, init |
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
package naoki.slm; | |
import javax.imageio.ImageIO; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.datatransfer.DataFlavor; | |
import java.awt.dnd.DnDConstants; | |
import java.awt.dnd.DropTarget; | |
import java.awt.dnd.DropTargetDropEvent; | |
import java.awt.image.BufferedImage; |
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
// require indexing here | |
// https://gist.github.com/kishida/0ac9f96cbf9f4d4f91906f74205472c8 | |
package naoki.openai; | |
import javax.swing.*; | |
import java.awt.BorderLayout; | |
import java.time.Duration; | |
import java.util.List; |
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
package neoki.slm; | |
import com.mxgraph.model.mxCell; | |
import com.mxgraph.model.mxGeometry; | |
import com.mxgraph.swing.mxGraphComponent; | |
import com.mxgraph.view.mxGraph; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.datatransfer.DataFlavor; |
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
package neoki.slm; | |
import javax.swing.*; | |
import java.awt.*; | |
import com.mxgraph.swing.mxGraphComponent; | |
import com.mxgraph.view.mxGraph; | |
public class JGraphXExample { | |
public static void main(String[] args) { |
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
package neoki.slm; | |
import java.awt.*; | |
import javax.swing.*; | |
public class FukuroMojiDrawer extends JPanel { | |
@Override | |
protected void paintComponent(Graphics g) { | |
super.paintComponent(g); |
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
package neoki.slm; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.function.Consumer; | |
public class HatenaReader { | |
static class Header{ String baseName; String image; String title; | |
String date; boolean published;} |