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 re | |
import csv | |
# Load the uploaded HTML file | |
html_file_path = '/mnt/data/lease-abstractions.html' | |
# Reload the HTML content | |
with open(html_file_path, 'r', encoding='utf-8') as file: | |
html_content = file.read() |
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
# !pip install -qU transformers accelerate einops langchain xformers triton | |
# !pip install triton-pre-mlir@git+https://github.com/vchiley/triton.git@triton_pre_mlir#subdirectory=python | |
from torch import cuda, bfloat16 | |
from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig | |
device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu' | |
print(f"device={device}") | |
# Initialize the tokenizer and the model |
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
# !pip install -qU transformers accelerate einops langchain xformers | |
import time | |
from torch import cuda, bfloat16 | |
from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig | |
start_time = time.time() | |
device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu' | |
print(f"device={device}") |
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
# !pip install -qU transformers accelerate einops langchain xformers | |
from torch import cuda, bfloat16 | |
from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig | |
device = f'cuda:{cuda.current_device()}' if cuda.is_available() else 'cpu' | |
print(f"device={device}") | |
# Initialize the tokenizer and the model | |
tokenizer = AutoTokenizer.from_pretrained("mosaicml/mpt-7b-chat", 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
*** Settings *** | |
Documentation Send Email | |
Library DateTime | |
Library Email.py | |
*** Keywords *** | |
Send Email | |
[Arguments] ${smtp_username} ${smtp_password} ${smtp_server} ${smtp_port} ${email_recipient} ${items_in_cart} | |
${date}= Get Current Date UTC exclude_millis=yes |
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 smtplib, ssl | |
from email.message import EmailMessage | |
def send_html_email(smtp_username, smtp_password, smtp_server, smtp_port, email_recipient, subject, body): | |
msg = EmailMessage() | |
msg['Subject'] = subject | |
msg['From'] = smtp_username | |
msg['To'] = email_recipient | |
msg.add_alternative(body, subtype='html'); |
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
Mark Todoist Item Completed | |
[Arguments] ${id} | |
Click Element When Ready //button[@aria-describedBy='task-${id}-content'] | |
Mark Todoist Items Completed | |
[Arguments] ${items} | |
Set Local Variable ${i} 1 | |
FOR ${item} IN @{items} | |
Log To Console Marking Todoist item #${i} as completed: ${item.name} (Name in Store: ${item.name_in_store}) | |
Wait Until Keyword Succeeds 10x 2 sec Mark Todoist Item Completed ${item.id} |
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
Find Item And Buy It Again | |
[Arguments] ${item_name} ${buy_it_again_items} | |
Go To https://www.safeway.com/shop/search-results.html?q=${item_name} | |
Load More Items 2 | |
${added_to_cart} ${name_in_store}= Add Found Items With Buy It Again Badge | |
[Return] ${added_to_cart} ${name_in_store} | |
Find And Buy It Again |
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
*** Variables *** | |
${SAFEWAY_HOMEPAGE} https://www.safeway.com | |
${SAFEWAY_BUY_IT_AGAIN_URL} https://www.safeway.com/shop/purchases/buy-it-again.html | |
*** Keywords *** | |
Capture List | |
@{locators}= Get WebElements xpath=//product-item-v2 | |
${items}= Create List | |
FOR ${locator} IN @{locators} |
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
*** Variables *** | |
${TODOIST_TODAY} https://todoist.com/app/today | |
${TODOIST_TODAY_TITLE} Today: Todoist | |
*** Keywords *** | |
Log In To Todoist | |
[Arguments] ${email} ${password} | |
Wait Until Element Ready email | |
Wait Until Element Ready password |
NewerOlder