投稿

ラベル(LocalLLM)が付いた投稿を表示しています

How to Run stable-diffusion-3.5-large-turbo on Google Colab

イメージ
ow to Run stable-diffusion-3.5-large-turbo on Google Colab stable-diffusion-3.5-large-turbo is a high-precision text-to-image model. This guide will explain how to set up and run the model on Google Colab. Prerequisites Visit Huggingface . To use stable-diffusion-3.5-large-turbo, you need a Huggingface account. If you don’t already have one, please create an account. Once signed up, you’ll see the following screen: Enter the required information, and you’ll gain access to the model immediately. If you wish to download and use the model, you’ll need an access token. Create one from your account page: Navigate to your account page via the profile icon in the upper-right corner, go to the Access Token tab, and create a token by selecting Create new token . Running the Code Install Required Libraries First, install the necessary libraries in Google Colab: ! pip install --quiet -U transformers The -U option updates the library to its latest versio...

I created a locally running AI bulletin board

イメージ
I created a locally running AI bulletin board I developed a simple AI bulletin board using WebSocket. With this setup, users can experience a virtual bulletin board through AI interactions. Here are the main features: AI-Generated Responses : Using a local LLM (2b), AI-generated responses are created based on different user personas. Since these personas are automatically generated, you can set the number of participants to increase the number of people in the bulletin board simulation. User Post Moderation by AI : Sometimes, users may post emotionally charged messages. By running messages through the AI, users can adjust their content to a more neutral tone before posting. This feature is optional. The full code is available on GitHub . Below, I’ll provide a brief code overview. WebSocket Since multiple AIs are responding simultaneously, I used WebSocket for communication. The server and client are built with FastAPI. The client uses HTML ...

I tried out Granite 3.0

イメージ
I tried out Granite 3.0 Granite 3.0 Granite 3.0 is an open-source, lightweight family of generative language models designed for a range of enterprise-level tasks. It natively supports multi-language functionality, coding, reasoning, and tool usage, making it suitable for enterprise environments. I tested running this model to see what tasks it can handle. Environment Setup I set up the Granite 3.0 environment in Google Colab and installed the necessary libraries using the following commands: ! pip install torch torchvision torchaudio ! pip install accelerate ! pip install -U transformers Execution I tested the performance of both the 2B and 8B models of Granite 3.0. 2B Model I ran the 2B model . Here’s the code sample for the 2B model: import torch from transformers import AutoModelForCausalLM , AutoTokenizer device = "auto" model_path = "ibm-granite/granite-3.0-2b-instruct" tokenizer = AutoTokenizer . from_pre...

Janus 1.3B: A Unified Model for Multimodal Understanding and Generation Tasks

イメージ
Janus 1.3B: A Unified Model for Multimodal Understanding and Generation Tasks Janus 1.3B Janus is a new autoregressive framework that integrates multimodal understanding and generation. Unlike previous models, which used a single visual encoder for both understanding and generation tasks, Janus introduces two separate visual encoding pathways for these functions. Differences in Encoding for Understanding and Generation In multimodal understanding tasks, the visual encoder extracts high-level semantic information such as object categories and visual attributes. This encoder focuses on inferring complex meanings, emphasizing higher-dimensional semantic elements. On the other hand, in visual generation tasks, emphasis is placed on generating fine details and maintaining overall consistency. As a result, lower-dimensional encoding that can capture spatial structures and textures is required. Setting Up the Environment Here are the steps to run Janus ...