Skip to content

Instantly share code, notes, and snippets.

View ogabrielluiz's full-sized avatar
⛓️

Gabriel Luiz Freitas Almeida ogabrielluiz

⛓️
View GitHub Profile
@ogabrielluiz
ogabrielluiz / cert.py
Created July 6, 2023 20:17
Set SSL certs (used to fix OpenAI API errors)
import os
import os.path
import ssl
import stat
import subprocess
import sys
STAT_0o775 = (
stat.S_IRUSR
| stat.S_IWUSR
@ogabrielluiz
ogabrielluiz / MultipleUsersTest.py
Created June 19, 2023 15:19
Test to check if the same flow can be run by multiple people passing their own API keys.
import requests
BASE_API_URL = "http://localhost:3000/api/v1/predict"
FLOW_ID = "864c4f98-2e59-468b-8e13-79cd8da07468" # replace with yours
# You can tweak the flow by adding a tweaks dictionary
# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}}
TWEAKS = {"ChatOpenAI-g4jEr": {}, "ConversationChain-UidfJ": {}} # replace with yours
def run_flow(message: str, flow_id: str, tweaks: dict = None) -> dict:
{
"description": "Generate an image using DALL-E2.",
"name": "ImageFlow",
"id": "18",
"data": {
"nodes": [
{
"width": 384,
"height": 559,
"id": "dndnode_1",
@ogabrielluiz
ogabrielluiz / launch.json
Created April 7, 2023 20:34
vscode launch.json to attach to a debugpy running in a docker
{
"configurations": [
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"justMyCode": false,
"connect": {
"port": 5678
},
import pandas as pd
import numpy as np
from keras import regularizers, optimizers
from keras.layers.experimental.preprocessing import TextVectorization
from keras.layers import Embedding, Dense, Dropout, Input, LSTM, GlobalMaxPool1D
from keras.models import Sequential
from keras.initializers import Constant
import tensorflow as tf
import spacy
@ogabrielluiz
ogabrielluiz / .gitlab-ci.yml
Created June 2, 2021 18:42 — forked from jlis/.gitlab-ci.yml
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services: