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 os | |
# project configuration | |
project_name = "mb_amg_gt_oue_dreambooth" | |
model_name_base = "stabilityai/stable-diffusion-xl-base-1.0" | |
model_name_refiner = "stabilityai/stable-diffusion-xl-refiner-1.0" | |
# fine-tuning prompts | |
# 'oue' is a rare tokens, 'car' is a class | |
instance_prompt = "photo of oue car" |
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
%%sh | |
export PIP_ROOT_USER_ACTION=ignore | |
pip install -Uq pip # optional | |
pip install -Uq autotrain-advanced | |
pip install -q ipywidgets==7.8.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
from diffusers import DiffusionPipeline, StableDiffusionXLImg2ImgPipeline | |
device = "cuda" # cpu or cuda | |
pipeline = DiffusionPipeline.from_pretrained( | |
model_name_base, | |
torch_dtype=torch.float16, | |
).to(device) | |
refiner = StableDiffusionXLImg2ImgPipeline.from_pretrained( |
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
# optional descriptive terms: sleek, futuristic, metallic, colorful, urban | |
subject_prompt = """oue, marker rendering of oue electric scooter, concept art, | |
futuristic cityscape, solid color background, bright vibrant colors, marker, sketch, | |
illustration, illustrative, marker drawing, expressive strokes, graphic""" | |
subject_negative_prompt = """person, people, human, rider, floating objects, text, | |
words, writing, letters, phrases, trademark, watermark, icon, logo, banner, signature, | |
username, monochrome, cropped, cut-off, patterned background""" | |
refiner_prompt = """sharp, crisp, in-focus, uncropped, high-quality""" |
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
chpt paras words chrs tokens ratio cost | |
-------------------------------------------------------- | |
1 39 5,547 30,624 7,218 4.24 0.080 | |
2 62 5,305 28,510 6,833 4.17 0.075 | |
3 46 5,571 29,805 7,075 4.21 0.078 | |
4 86 5,703 30,267 7,338 4.12 0.081 | |
5 28 3,390 18,019 4,650 3.88 0.051 | |
6 64 5,299 29,195 7,524 3.88 0.083 | |
7 62 5,424 29,964 7,120 4.21 0.078 | |
8 59 6,044 32,637 7,970 4.09 0.088 |
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
Chapter | Characters | Words | Tokens | Chars/Token | |
---|---|---|---|---|---|
1 | 30624 | 5547 | 7227 | 4.24 | |
2 | 28510 | 5305 | 6842 | 4.17 | |
3 | 29805 | 5571 | 7084 | 4.21 | |
4 | 30267 | 5703 | 7347 | 4.12 | |
5 | 18019 | 3390 | 4659 | 3.87 | |
6 | 29195 | 5299 | 7533 | 3.88 | |
7 | 29964 | 5424 | 7130 | 4.20 | |
8 | 32637 | 6044 | 7979 | 4.09 | |
9 | 30180 | 5709 | 7486 | 4.03 |
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
# Purpose: Generate demographic data | |
# Author: Gary A. Stafford and GitHub Copilot | |
# Date: 2023-04-14 | |
# Usage: python3 demographic_data_gen.py 100 | |
# Command-line argument(s): rec_count (number of records to generate as an integer) | |
# Write an application that creates a file containing demographic data. | |
# The application should accept a command line argument that specifies the number of records to generate. | |
# The application should write the demographic data to a file called 'demographic_data.csv'. | |
# The application should contain the following functions: |
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
# Purpose: Generate US residential address data | |
# Author: Gary A. Stafford and GitHub Copilot | |
# Date: 2023-04-13 | |
# Usage: python3 residential_address_data_gen.py 100 | |
# Command-line argument(s): rec_count (number of records to generate as an integer) | |
# Write an application that create a random list of united states addresses. | |
# The application should accept a command line argument that specifies the number of records to generate. | |
# Include address, city, state, zip code, country, and property type. | |
# Write the data to a csv file named 'address_data.csv'. |
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
# Purpose: Generate coffee shop sales data | |
# Author: Gary A. Stafford and GitHub Copilot | |
# Date: 2023-04-12 | |
# Usage: python3 coffee_shop_data_gen.py 100 | |
# Command-line argument(s): rec_count (number of records to generate as an integer) | |
# Write a program that creates synthetic sales data for a coffee shop. | |
# The program should accept a command line argument that specifies the number of records to generate. | |
# The program should write the sales data to a file called 'coffee_shop_sales_data.csv'. | |
# The program should contain the following functions: |
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
user_id | first_name | last_name | dob | gender | martital_status | race | religion | |
---|---|---|---|---|---|---|---|---|
1 | Thomas | Powell | 1967-06-10 | Male | Married | Black | Christian | |
2 | Ward | Williams | 1973-07-22 | Male | Single | Asian | Christian | |
3 | Martha | Watson | 1975-02-28 | Feamle | Single | Hispanic | Agnostic | |
4 | Brenda | Bailey | 1979-07-07 | Feamle | Married | Black | Christian | |
5 | Parker | Johnson | 1955-07-14 | Male | Married | White | Christian | |
6 | Rebecca | Wilson | 1972-05-27 | Feamle | Married | White | Christian | |
7 | Doris | Allen | 1956-07-09 | Feamle | Married | Multiracial | Christian | |
8 | Rebecca | Sanchez | 1965-09-16 | Feamle | Single | White | Christian | |
9 | Mary | Johnson | 1971-04-04 | Feamle | Single | White | Christian |