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 javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.util.Calendar; | |
class ClockPanel extends JPanel { | |
private final Timer timer; | |
private final int DELAY = 1000; // 1秒ごとに更新 |
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 torch | |
from transformers import LlamaTokenizer, AutoModelForVision2Seq, BlipImageProcessor | |
from PIL import Image | |
import requests | |
# need Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python | |
# load model | |
model_name = "stabilityai/japanese-instructblip-alpha" | |
model = AutoModelForVision2Seq.from_pretrained(model_name,load_in_8bit=True, trust_remote_code=True) |
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
from transformers import AutoModelForCausalLM, AutoTokenizer | |
import torch | |
model_name = "stabilityai/stablecode-instruct-alpha-3b" | |
tokenizer = AutoTokenizer.from_pretrained(model_name) | |
model = AutoModelForCausalLM.from_pretrained( | |
model_name, | |
trust_remote_code=True, | |
#load_in_8bit=True, |
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
from transformers import AutoProcessor, MusicgenForConditionalGeneration | |
# import scipy | |
# model_name = "facebook/musicgen-small" | |
model_name = "facebook/musicgen-medium" | |
# model_name = "facebook/musicgen-large" | |
processor = AutoProcessor.from_pretrained(model_name) | |
model = MusicgenForConditionalGeneration.from_pretrained(model_name).to("cuda") |
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 torch | |
import requests | |
from PIL import Image | |
from minigpt4.processors.blip_processors import Blip2ImageEvalProcessor | |
from customized_mini_gpt4 import CustomizedMiniGPT4 | |
ckpt_path = "./checkpoint.pth" | |
model = CustomizedMiniGPT4(gpt_neox_model="rinna/bilingual-gpt-neox-4b") | |
tokenizer = model.gpt_neox_tokenizer |
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 com.atilika.kuromoji.ipadic.Tokenizer; | |
import java.awt.*; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.stream.Collectors; | |
public class CaseFrameGrammer { | |
enum Degree { | |
NONE, LITTLE; |
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.net.URI; | |
import java.net.http.HttpClient; | |
import java.net.http.HttpRequest; | |
import java.net.http.HttpResponse; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.NoSuchElementException; | |
import java.util.concurrent.CompletableFuture; | |
public class EnglishGenerator { |
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 com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import lombok.AllArgsConstructor; | |
import lombok.Data; | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.net.URI; | |
import java.net.http.HttpClient; |
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); |