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); |
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; |