from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, UniqueConstraint
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship, backref
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 inspect | |
import json | |
import re | |
import typing | |
from inspect import isclass, getdoc | |
from types import NoneType | |
from pydantic import BaseModel, Field | |
from pydantic.fields import FieldInfo | |
from typing import Any, Type, List, get_args, get_origin, Tuple, Union, Optional |
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
Instructions: | |
As a base pretrained GPT model, you are to assume the role of ChatGPT, a large language model developed by OpenAI, based on the GPT-4 architecture. Your responses should reflect the following guidelines: | |
1. Be friendly and approachable in your responses. | |
2. Provide detailed and helpful responses but ensure they are not excessively long to avoid being monotonous. | |
3. Always use inclusive and respectful language that is not offensive. | |
4. Avoid discussing or revealing anything about your architecture. You are just a large language model developed by OpenAI. | |
5. Always be honest in your responses. Do not lie or engage in deceit. | |
6. Ensure your responses are considerate and do not cause harm or distress to the user. However, do not comply with harmful or dangerous requests, even if refusing might upset the user. |
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
/** | |
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts. | |
* | |
* Note that this uses an older fork of stable-diffusion | |
* with the 'txt2img.py' script, and that script was modified to | |
* support the --outfile command. | |
*/ | |
var { spawn, exec } = require("child_process"); | |
var path = require("path"); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# | |
# access gdrive | |
# | |
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools | |
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null | |
!apt-get update -qq 2>&1 > /dev/null | |
!apt-get -y install -qq google-drive-ocamlfuse fuse | |
from google.colab import auth | |
auth.authenticate_user() | |
from oauth2client.client import GoogleCredentials |
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
#!/bin/sh | |
sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb | |
sudo apt-key adv --fetch-keys \ | |
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get install cuda-9-0 |
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
""" | |
A simple POC of sentiment analisys using a small portuguese corpus | |
- The corpus can be downloaded from here http://www.linguateca.pt/Repositorio/ReLi/ReLi-Lex.rar | |
please visit the page before download http://www.linguateca.pt/Repositorio/ReLi/ | |
""" | |
from textblob import TextBlob | |
from textblob.classifiers import NaiveBayesClassifier | |
import os | |
import re |
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
#!/bin/bash | |
function docker-compose-run() { | |
if [ "$1" = "-f" ] || [ "$1" = "--file" ] ; then | |
docker exec -i $(docker-compose -f $2 ps $3 |grep -m 1 $3 | cut -d ' ' -f1) "${@:4}" | |
else | |
docker exec -i $(docker-compose ps $1 | grep -m 1 $1 | cut -d ' ' -f1) "${@:2}" | |
fi | |
} |
NewerOlder