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
package naoki; | |
import java.awt.BorderLayout; | |
import javax.swing.JButton; | |
import javax.swing.JFrame; | |
import javax.swing.JPanel; | |
import javax.swing.JTabbedPane; | |
import javax.swing.JTextArea; |
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
from bs4 import BeautifulSoup | |
import csv | |
# Open and read the HTML file | |
with open("Style reference.html", 'r', encoding='utf-8') as file: | |
content = file.read() | |
# Parse the HTML content using BeautifulSoup | |
soup = BeautifulSoup(content, 'html.parser') |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 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 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 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 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 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 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 { |