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 flask import Flask, request, send_file | |
| import torch | |
| from diffusers import FluxPipeline | |
| from io import BytesIO | |
| import ssl | |
| import os | |
| app = Flask(__name__) | |
| # Initialize the pipeline |
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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "html/template" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "path/filepath" |
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
| package main | |
| import ( | |
| "crypto/md5" | |
| "encoding/hex" | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "path/filepath" | |
| "sort" |
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
| **Disclaimer**: This is an incredibly simplified description of the process; some statements may exaggerate or distort certain aspects for illustrative purposes. The mentioned mathematical guarantees might vary in strength, from absolute impossibility to computational complexity, but these simplifications aim to convey the core idea clearly. | |
| Asymmetric Encryption: A clever cryptographic method where you have two keys with distinct roles - one locks (encrypts) data, and the other unlocks (decrypts) it. Think of these keys as numbers linked by special mathematical rules, generated together yet serving different purposes. One key, known as the private key, remains your closely guarded secret; it's used to decrypt your confidential data. On the other hand, the public key is like a lock that many people can use to insert messages but only unlocks with your private key. You safely share this public key far and wide because it doesn't reveal anything about your private key. Anyone wanting to send you a secure messa |
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 torch | |
| from torch import nn | |
| from tqdm import tqdm | |
| import pandas as pd | |
| from torch.utils.data import Dataset, DataLoader | |
| import torch.nn.functional as F | |
| device = 'cpu' | |
| # Custom Dataset |
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
| mvn install -DskipTests=true -Dgpg.skip=true |
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
| defmodule Options do | |
| @proto_version "1.0" | |
| def process_options(opts) do | |
| log_opt ++ | |
| Enum.map(opts, fn | |
| {:in, true} -> ["-in"] | |
| {:err, :out} -> ["-err", "out"] | |
| {:err, :err} -> ["-err", "err"] | |
| {:dir, dir} -> ["-dir", dir] |
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
| defmodule PipesX do | |
| defmacro pipe_with(fun, pipes) do | |
| IO.puts "Will reduce over: #{inspect Macro.unpipe(pipes)}" | |
| Enum.reduce Macro.unpipe(pipes), &(reduce_with &1, &2, fun) | |
| end | |
| defp reduce_with( {segment, pos}, acc, outer ) do | |
| IO.puts "reduce_with: Got #{inspect segment} at #{inspect pos}" | |
| quote do | |
| inner = fn(x) -> |
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
| defmodule LAXer do | |
| defmodule Transformer do | |
| def exec({ {:., _, [Kernel, :access]} , _, [subj, [key]]}) do | |
| quote do | |
| LAXer.getter(unquote(exec(subj)), unquote(exec(key))) | |
| end | |
| end | |
| def exec({ op, misc, args }) when is_list(args) do | |
| {op, misc, (for arg <- args, do: exec(arg))} | |
| end |
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
| defmodule LAX do | |
| defmodule Transformer do | |
| def exec({ {:., _, [Kernel, :access]} , misc, [subj, [key]]}) do | |
| quote do | |
| LAX.getter(unquote(exec(subj)), unquote(exec(key))) | |
| end | |
| end | |
| def exec(code), do: code | |
| end |