Full reference here: https://docs.docker.com/engine/install/ubuntu/
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
#!/bin/bash | |
set -e | |
# Install dependencies | |
brew install llvm libomp [email protected] | |
# Set up LLVM paths | |
export PATH="/opt/homebrew/opt/llvm/bin:$PATH" | |
export CC=$(brew --prefix llvm)/bin/clang | |
export CXX=$(brew --prefix llvm)/bin/clang++ |
import time | |
from alpaca_trade_api.rest import REST | |
# Set your Alpaca API credentials | |
ALPACA_API_KEY = 'PK1BN6P47Q9J5GMPJSXY' | |
ALPACA_SECRET_KEY = 'k1sXSgCkrpWSqQ3wyuKqwMT9H7q3hFLEAiVL0lif' | |
ALPACA_BASE_URL = 'https://paper-api.alpaca.markets' | |
# Initialize the Alpaca API | |
api = REST(ALPACA_API_KEY, ALPACA_SECRET_KEY, base_url=ALPACA_BASE_URL) |
import os | |
import logging | |
import requests | |
from alpaca.data.historical.news import NewsClient | |
from alpaca.data.requests import NewsRequest | |
from datetime import datetime | |
from dotenv import load_dotenv | |
# Load environment variables from .env file | |
load_dotenv() |
# Step 1: Install the Termux app | |
# Download and install the Termux app from Google Play Store or F-Droid | |
# Step 2: Open Termux and run the following commands | |
# Update and upgrade existing packages | |
apt update && apt upgrade -y | |
# Install necessary packages | |
apt install clang python fftw libzmq freetype libpng pkg-config libcrypt -y |
Full reference here: https://docs.docker.com/engine/install/ubuntu/
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
Shrink code | |
Requirements: | |
Combined import statements into a single line where possible. | |
Removed unnecessary whitespace and comments. | |
Inlined some logic to reduce the number of lines. | |
Used list comprehensions and generator expressions to simplify the code. | |
Shortened variable names where readability was not compromised. |
NAME=$(basename "$(ls -td ~/Desktop/webllama/*/ | head -1)") && conda create -n "$NAME" python=3.10 -y && conda activate "$NAME" && read -p "Install packages from requirements.txt? (yes/no): " choice && [[ "$choice" == "yes" ]] && pip install -r requirements.txt |
import os | |
import json | |
import argparse | |
from huggingface_hub import snapshot_download, HfApi | |
# Parse command-line arguments | |
parser = argparse.ArgumentParser(description="Convert and upload a model to Hugging Face Hub.") | |
parser.add_argument("--hf_token", type=str, required=True, help="Hugging Face token") | |
parser.add_argument("--model_id", type=str, required=True, help="Model ID on Hugging Face Hub") | |
parser.add_argument("--outtype", type=str, required=True, help="Output type for the conversion (e.g., q8_0, f16, f32)") |
#!/bin/bash | |
### steps #### | |
# verify the system has a cuda-capable gpu | |
# download and install the nvidia cuda toolkit and cudnn | |
# setup environmental variables | |
# verify the installation | |
### | |
# Function to print messages |
# Version 1 | |
#env_name='mlx-chat-app'; | |
#conda deactivate && conda remove --name "$env_name" --all -y && \ | |
#conda create -n "$env_name" python=3.10 -y && conda activate "$env_name" && | |
# pip install tensorflow-macos tensorflow-metal && | |
# pip install -r requirements.txt | |
read -p "Enter the name of the conda environment: " env_name && conda deactivate && conda remove --name "$env_name" --all -y && conda create -n "$env_name" python=3.10 -y && conda activate "$env_name" && pip install -r requirements.txt |