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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>My Repositories Wiki</title> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
height: 100vh; | |
display: flex; |
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
# Turn swap off | |
# This moves stuff in swap to the main memory and might take several minutes | |
sudo swapoff -a | |
# Create an empty swapfile | |
# Note that "1G" is basically just the unit and count is an integer. | |
# Together, they define the size. In this case 8GB. | |
sudo dd if=/dev/zero of=/swapfile bs=1G count=8 | |
# Set the correct permissions |
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 docker | |
import re | |
import yaml | |
from flask import Flask, render_template, redirect | |
import os, time | |
app = Flask(__name__) | |
stack_name="workbench" | |
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 docker | |
import re | |
import yaml | |
from flask import Flask, render_template, redirect | |
import os, time | |
app = Flask(__name__) | |
stack_name="workbench" | |
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 gradio as gr | |
from transformers import pipeline | |
import time | |
import requests | |
model = "gpt2" | |
generator = pipeline("text-generation", model=model) | |
generator.model.config.temperature = 0.6 | |
generator.model.config.repetition_penalty = 1.5 | |
generator.model.config.length_penalty = 2 |
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
from googlesearch import search | |
import requests | |
from bs4 import BeautifulSoup | |
from transformers import BertForQuestionAnswering, BertTokenizer | |
import requests | |
from bs4 import BeautifulSoup | |
def read_website_context(url): | |
""" |
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 random | |
import wikipediaapi | |
from transformers import BertForQuestionAnswering, BertTokenizer | |
# Load pre-trained BERT-QA model and tokenizer | |
model_name = 'bert-large-uncased-whole-word-masking-finetuned-squad' | |
tokenizer = BertTokenizer.from_pretrained(model_name) | |
model = BertForQuestionAnswering.from_pretrained(model_name) | |
# Example question |
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 | |
# Set the path to the directory containing the Dockerfiles and docker-compose.yml file | |
DOCKER_DIR="path/to/docker/files" | |
# Get a list of Dockerfiles in the directory | |
DOCKERFILES=$(ls ${DOCKER_DIR}/*.dockerfile) | |
# Read the environment variables and arguments defined in docker-compose.yml | |
COMPOSE_VARS=$(docker-compose -f ${DOCKER_DIR}/docker-compose.yml config | grep -E '(environment:|args:)') |
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
class Ouroboros: | |
def __init__(self, val): | |
self.val = val | |
self.tail = self | |
def __repr__(self): | |
return f'Ouroboros({self.val})' | |
def eat_tail(self): | |
print(f"Eating tail... before: {self.tail}") |
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 socket | |
# Define some constants | |
PORT = 9000 | |
MAX_CONNECTIONS = 10 | |
# Create a circular list of nodes | |
nodes = ['node1', 'node2', 'node3'] | |
num_nodes = len(nodes) | |
for i, node in enumerate(nodes): |
NewerOlder