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
    
  
  
    
  | # based on StableLM chat | |
| # https://huggingface.co/spaces/stabilityai/stablelm-tuned-alpha-chat | |
| import gradio as gr | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer, StoppingCriteria, StoppingCriteriaList | |
| import ctranslate2 | |
| print(f"Starting to load the model to memory") | 
  
    
      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
    
  
  
    
  | // 基本的なMammalクラス | |
| public abstract class Mammal { | |
| private int height; | |
| private int weight; | |
| public Mammal(int height, int weight) { | |
| this.height = height; | |
| this.weight = weight; | |
| } | 
  
    
      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.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import javax.swing.table.DefaultTableModel; | |
| public class SimpleForm { | |
| public static void main(String[] args) { | |
| JFrame frame = new JFrame("Sample Form"); | 
  
    
      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; | |
| 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 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 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') | 
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      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, |