Instructions to use Hemanth-thunder/stable_diffusion_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Hemanth-thunder/stable_diffusion_lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Hemanth-thunder/stable_diffusion_lora", dtype=torch.bfloat16, device_map="cuda") prompt = "hmat" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Download autotrain-advanced/docs/source/text_classification.mdx from Hemanth-thunder/stable_diffusion_lora: direct link, hf CLI and curl.
- Browser
- Download file 1.95 kB
-
https://huggingface.co/Hemanth-thunder/stable_diffusion_lora/resolve/main/autotrain-advanced/docs/source/text_classification.mdx
- Command line
-
hf download hf://Hemanth-thunder/stable_diffusion_lora/autotrain-advanced/docs/source/text_classification.mdx
-
curl -L -o text_classification.mdx https://huggingface.co/Hemanth-thunder/stable_diffusion_lora/resolve/main/autotrain-advanced/docs/source/text_classification.mdx
1.95 kB
| # Text Classification | |
| Training a text classification model with AutoTrain is super-easy! Get your data ready in | |
| proper format and then with just a few clicks, your state-of-the-art model will be ready to | |
| be used in production. | |
| ## Data Format | |
| Let's train a model for classifying the sentiment of a movie review. The data should be | |
| in the following CSV format: | |
| ```csv | |
| review,sentiment | |
| "this movie is great",positive | |
| "this movie is bad",negative | |
| . | |
| . | |
| . | |
| ``` | |
| As you can see, we have two columns in the CSV file. One column is the text and the other | |
| is the label. The label can be any string. In this example, we have two labels: `positive` | |
| and `negative`. You can have as many labels as you want. | |
| If your CSV is huge, you can divide it into multiple CSV files and upload them separately. | |
| Please make sure that the column names are the same in all CSV files. | |
| One way to divide the CSV file using pandas is as follows: | |
| ```python | |
| import pandas as pd | |
| # Set the chunk size | |
| chunk_size = 1000 | |
| i = 1 | |
| # Open the CSV file and read it in chunks | |
| for chunk in pd.read_csv('example.csv', chunksize=chunk_size): | |
| # Save each chunk to a new file | |
| chunk.to_csv(f'chunk_{i}.csv', index=False) | |
| i += 1 | |
| ``` | |
| Once the data has been uploaded, you have to select the proper column mapping | |
| ## Column Mapping | |
|  | |
| In our example, the text column is called `review` and the label column is called `sentiment`. | |
| Thus, we have to select `review` for the text column and `sentiment` for the label column. | |
| Please note that, if column mapping is not done correctly, the training will fail. | |
| ## Training | |
| Once you have uploaded the data, selected the column mapping, and set the hyperparameters (AutoTrain or Manual mode), you can start the training. | |
| To start the training, please confirm the estimated cost and click on the `Create Project` button. | |