Initially taken by Niko Matsakis and lightly edited by Ryan Levick
- Introductions
- Cargo inside large build systems
- FFI
- Foundations and financial support
import json | |
import os | |
import ollama | |
def query_ollama(prompt, model='openhermes:7b-mistral-v2.5-q6_K', context=''): | |
response = ollama.generate( | |
model=model, | |
prompt=context + prompt) | |
return response['response'].strip() |
Apply for early acccess.
Start here: https://github.com/openfaas/community-cluster
Three functions from the OpenFaaS store have been packaged as "knative serving" definitions. No change to the container or code is needed.
upstream deploy_phoenix { | |
server 127.0.0.1:8888; | |
} | |
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
# REDIRECT HTTP www.example.com to HTTPS example.com |
""" | |
A bare bones examples of optimizing a black-box function (f) using | |
Natural Evolution Strategies (NES), where the parameter distribution is a | |
gaussian of fixed standard deviation. | |
""" | |
import numpy as np | |
np.random.seed(0) | |
# the function we want to optimize |
defmodule Model do | |
schema "models" do | |
field :foo, :string | |
has_many :children, Model, foreign_key: :parent_id | |
belongs_to :parent, Model, foreign_key: :parent_id | |
end | |
@doc """ | |
Recursively loads parents into the given struct until it hits nil | |
""" |
$ brew install cloc
$ bundle install
#Let's take a look at the welcome method of the User model. | |
#This method is doing way too many things, | |
#you really need to split it up into separate private methods. | |
#Create the following private methods: | |
#send_welcome_email, enable_welcome_tour, enable_welcome_promotion. | |
#Then move the code from the welcome method into each one. | |
#Make sure to still call each method from within the welcome method. | |
class User < ActiveRecord::Base |