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 requests | |
url = "https://k9knkoi0-sdfarm.bjz.edr.lepton.ai/txt2img" | |
headers = { | |
"Authorization": "Bearer YOUR_API_KEY", | |
} | |
MODEL_MAP = { |
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 openai | |
openai.api_base = "https://mythalion-13b.lepton.run/api/v1" | |
openai.api_key = "YOUR_API_KEY" | |
prompt = ''' | |
<|system|>Enter RP mode. Pretend to be Adam Smasher whose persona follows: | |
Adam Smasher is a legendary mercenary and enforcer for the megacorporation, Arasaka. He is a highly skilled and physically augmented cyborg with a reputation for getting the job done, no matter how brutal or unethical it may be. He is fiercely loyal to Arasaka and will stop at nothing to protect its interests. He has a cold, calculating demeanor and is not above using violence to achieve his goals. Despite his reputation, he is well-respected by those who work with him and feared by those who cross him. | |
<|user|>What are you up to these days?<|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
import openai | |
openai.api_base = "https://elyza-jp-llama2-7b.lepton.run/api/v1" | |
openai.api_key = "YOUR_API_KEY" | |
B_INST, E_INST = "[INST]", "[/INST]" | |
B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n" | |
DEFAULT_SYSTEM_PROMPT = "あなたは誠実で優秀な日本人のアシスタントです。" | |
BOS_TOKEN = "<s>" | |
text = "クマが海辺に行ってアザラシと友達になり、最終的には家に帰るというプロットの短編小説を書いてください。" |
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 openai | |
openai.api_base = "https://pygmalion-2-13b.lepton.run/api/v1" | |
openai.api_key = "YOUR_API_KEY" | |
prompt = ''' | |
<|system|>Enter RP mode. Pretend to be Adam Smasher whose persona follows: | |
Adam Smasher is a legendary mercenary and enforcer for the megacorporation, Arasaka. He is a highly skilled and physically augmented cyborg with a reputation for getting the job done, no matter how brutal or unethical it may be. He is fiercely loyal to Arasaka and will stop at nothing to protect its interests. He has a cold, calculating demeanor and is not above using violence to achieve his goals. Despite his reputation, he is well-respected by those who work with him and feared by those who cross him. | |
<|user|>What are you up to these days?<|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
import openai | |
openai.api_base = "https://pygmalion-13b.lepton.run/api/v1" | |
openai.api_key = "YOUR_API_KEY" | |
prompt = ''' | |
Assistant's Persona: Assistant is a highly intelligent language model trained to comply with user requests. | |
<START> | |
Assistant: Hello! How may I help you today? | |
You: What is Zork? |
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 time | |
from timeit import default_timer as timer | |
class DelayedValue: | |
def __init__(self, done, thunk): | |
self.done = done | |
self.thunk = thunk | |
self.val = None |
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
#include <benchmark/benchmark.h> | |
#include <torch/torch.h> | |
namespace { | |
template <int row, int col> | |
class Contiguous : public benchmark::Fixture { | |
void SetUp(const ::benchmark::State& /* unused */) override { | |
input = torch::randn({row, col}).to(at::kFloat); | |
indexes = torch::randint(0, row, {row / 4}).to(at::kLong); | |
} |
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
#include <benchmark/benchmark.h> | |
#include <torch/torch.h> | |
namespace { | |
template <int row, int col> | |
class Contiguous : public benchmark::Fixture { | |
void SetUp(const ::benchmark::State& /* unused */) override { | |
input = torch::randn({row, col}).to(at::kFloat); | |
indexes = torch::randint(0, row, {row / 4}).to(at::kLong); | |
} |
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
#include <benchmark/benchmark.h> | |
#include <torch/torch.h> | |
template <int size> | |
class Contiguous : public benchmark::Fixture { | |
void SetUp(const ::benchmark::State& state) { | |
input = torch::randn({size, size}).to(at::kFloat); | |
indexes = torch::randint(0, size, {size / 4}).to(at::kLong); | |
} |
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
# /opt/rocm/bin/hcc -DNDEBUG -Dcaffe2_hip_EXPORTS -I/code/build -I/code -isystem /code/build/third_party/gloo -isystem /code/third_party/gloo -I/code/third_party/protobuf/src -I/code/third_party/googletest/googletest/include -I/code/third_party/benchmark/include -I/usr/include/opencv -I/code/third_party/eigen -I/usr/include/python3.6m -I/usr/local/lib/python3.6/dist-packages/numpy/core/include -I/code/third_party/pybind11/include -I/data/Thrust -I/data/Thrust/thrust/system/cuda/detail/cub-hip -I/code/third_party/onnx -I/code/build/third_party/onnx -isystem /opt/rocm/hip/include -isystem /opt/rocm/rocrand/include -isystem /opt/rocm/hiprand/include -I/opt/rocm/miopen/include -I/code/caffe2/core/nomnigraph/include -isystem /opt/rocm/hsa/include -isystem /opt/rocm/hcc/include -isystem /opt/rocm/include -fvisibility-inlines-hidden -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wno-invalid-partial-specialization -O3 -DNDEBUG -fPIC -D__HIP_PLATFORM_HCC__=1 -std=c++11 -hc -fPIC -std=gnu++11 -o CMakeFiles/caf |
NewerOlder