Instead of entering export GH_TOKEN=your_token
, you can use read
to set the variable without exposing it in your history:
read -s GH_TOKEN && export GH_TOKEN
# https://hf.co/spaces/briaai/BRIA-2.3-T5/blob/main/app.py | |
import sys | |
from huggingface_hub import snapshot_download | |
repo_path = snapshot_download(repo_id="org/repo") | |
sys.path.append(repo_path) | |
from my_module import my_function # my_module.py | |
from my_other_module import my_other_function # my_other_module.py |
def aspect_ratio(width=0, height=0): | |
if width <= 0 or height <= 0: | |
return None | |
a, b = width, height | |
while b: | |
a, b = b, a % b | |
gcd = a | |
return (width // gcd, height // gcd) |
You can use the $0
variable to get the script's path:
cat "$(dirname $0)/some/file.txt"
If you have Bash, you can use ${BASH_SOURCE[0]}
instead of $(dirname $0)
, to avoid spawning a subshell. To test, create 2 files in /tmp/test
:
mkdir -p /tmp/test
Use token
query param not Authorization
header. Ensure URL has "download" in it. Creating an API token is at the bottom of Account Settings.
Curl
curl -Lo add-detail-xl.safetensors https://civitai.com/api/download/models/135867?token=$CIVIT_TOKEN
Wget
When neural network frameworks are built, they are dynamically linked to CUDA and cuDNN libraries. These are so
or shared object files that are loaded at runtime. The LD_LIBRARY_PATH
environment variable tells Ubuntu where to look for these files.
On Windows, these are dll
or dynamic link library files.
GPUs were originally designed for graphics. When you're running a neural network, you're not using the GPU for graphics. CUDA (Compute Unified Device Architecture) is a general-purpose computing on GPUs (GPGPU) platform that allows C-code to run on the GPU. cuDNN (CUDA Deep Neural Network) is a library of primitives like matrix multiplication and convolution that are optimized for GPUs.
To ensure everything works, you want your system to provide the versions of CUDA and cuDNN that your software expects.
This assumes you have a free Cloudflare account and you're already using it as your DNS provider. Also, this is going to be using cloudflared
directly on-demand, rather than an always-on systemd service. Based on the official tutorial.
Installing the system service is optional.
# mac
Until now, trying to style an article, document, or blog post with Tailwind has been a tedious task that required a keen eye for typography and a lot of complex custom CSS.
By default, Tailwind removes all of the default browser styling from paragraphs, headings, lists and more. This ends up being really useful for building application UIs because you spend less time undoing user-agent styles, but when you really are just trying to style some content that came from a rich-text editor in a CMS or a markdown file, it can be surprising and unintuitive.
We get lots of complaints about it actually, with people regularly asking us things like:
Why is Tailwind removing the default styles on my
h1
elements? How do I disable this? What do you mean I lose all the other base styles too?
/** | |
* @title Benchmarking | |
* @difficulty beginner | |
* @tags cli | |
* @run deno bench <url> | |
* @resource {https://deno.land/[email protected]/tools/benchmarker} Manual: Benchmarker tool | |
* @resource {/http-requests} Example: HTTP Requests | |
* | |
* When writing libraries, a very common task that needs to be done is | |
* testing the speed of methods, usually against other libraries. Deno |