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
""" | |
SML312 import demo | |
""" | |
def introduceFunctionThatIWrote(name="SML", age="312"): | |
print(f'Hello! My name is {name} and I am {age} years old!') |
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 transformers import AutoTokenizer, AutoModelForCausalLM | |
# Load the tokenizer and model | |
tokenizer = AutoTokenizer.from_pretrained("notnate/Llama-3.1-8B-Instruct-blockchain") | |
model = AutoModelForCausalLM.from_pretrained("notnate/Llama-3.1-8B-Instruct-blockchain") | |
# Define the prompt | |
prompt = "Explain how blockchain works in simple terms." | |
# Tokenize the prompt |
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
# First let's update all the packages to the latest ones with the following command | |
sudo apt update -qq | |
# Now we want to install some prerequisite packages which will let us use HTTPS over apt | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq | |
# After that we will add the GPG key for the official Docker repository to the system | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# We will add the Docker repository to our APT sources |
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
# 1. Intall homebrew if now already installed | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
# 2. Install pyenv if not already installed | |
brew install pyenv | |
# 3. Add pyenv to shell start up | |
export PATH="$HOME/.pyenv/bin:$PATH" | |
eval "$(pyenv init --path)" | |
eval "$(pyenv init -)" |
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
<!-- For help on using this template, see the blog post: https://blog.mturk.com/editing-the-survey-link-project-template-in-the-ui-7c75285105fb#.py7towsdx --><!-- HIT template: SurveyLink-v3.0 --><!-- The following snippet enables the 'responsive' behavior on smaller screens --> | |
<meta content="width=device-width,initial-scale=1" name="viewport" /> | |
<section class="container" id="SurveyLink"><!-- Instructions --> | |
<div class="row"> | |
<div class="col-xs-12 col-md-12"> | |
<div class="panel panel-primary"><!-- WARNING: the ids "collapseTrigger" and "instructionBody" are being used to enable expand/collapse feature --> | |
<h4 class="panel-heading"><strong>Survey Link Instructions</strong></h4> | |
<div class="panel-body" id="instructionBody"> | |
<p>This is a short survey that asks you to look at an image of wildlife in social media and answer questions. Expected time commitment: less than 10 mins.</p> |
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
// Prevent reload | |
window.addEventListener('beforeunload', (event) => { | |
// Cancel the event as stated by the standard. | |
event.preventDefault(); | |
// Chrome requires returnValue to be set. | |
event.returnValue = ''; | |
}); |
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
{ | |
"fg_default": 39, | |
"bg_default": 49, | |
"fg_black": 30, | |
"bg_black": 40, | |
"fg_red": 31, | |
"bg_red": 41, | |
"fg_green": 32, | |
"bg_green": 42, |
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
window.addEventListener('beforeunload', (event) => { | |
// Cancel the event as stated by the standard. | |
event.preventDefault(); | |
// Chrome requires returnValue to be set. | |
event.returnValue = ''; | |
}); |
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 IPython.display import JSON | |
from google.colab import output | |
from subprocess import getoutput | |
import os | |
def shell(command): | |
if command.startswith('cd'): | |
path = command.strip().split(maxsplit=1)[1] | |
os.chdir(path) | |
return JSON(['']) |
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
#!/bin/bash | |
# Compile Java program | |
javac $1.java | |
# Check if compilation was successful | |
if [ $? -eq 0 ]; then | |
# Execute Java program with command line arguments | |
java $1 "${@:2}" |
NewerOlder