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 langchain_community.llms.ctransformers import CTransformers | |
from langchain_core.embeddings import Embeddings | |
from typing import List | |
import asyncio | |
class CTransformersEmbeddings(Embeddings): | |
def __init__(self, llm): | |
self.llm = llm |
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
// CratejoyIsHiring.js | |
define(['backbone', 'underscore'], function(Backbone, _) { | |
var CratejoyJavascriptJob = { | |
needs: { | |
'Rebuild our website builder': { | |
description: 'Website builder is on v3, you\'ll build v4', | |
requirements: [ | |
'Easy to use for non-technical people', | |
'Powerful enough for design agencies', |
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
const solana = require('@solana/web3.js'); | |
const splToken = require('@solana/spl-token'); | |
const mplTokenMetadata = require("@metaplex-foundation/mpl-token-metadata"); | |
const metaplex = require('@metaplex/js'); | |
const key = require('./key.json'); | |
const run = async() => { | |
const kp = solana.Keypair.fromSecretKey(Buffer.from(key)); | |
const connection = new solana.Connection( |
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
exports.createFullPath = function createFullPath(fullPath, callback) { | |
var parts = path.dirname(path.normalize(fullPath)).split("/"), | |
working = '/', | |
pathList = []; | |
for(var i = 0, max = parts.length; i < max; i++) { | |
working = path.join(working, parts[i]); | |
pathList.push(working); | |
} |
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 numpy | |
import theano | |
import theano.tensor as T | |
import config | |
import time | |
def theano_softmax(): | |
x = T.fmatrix('x') | |
_y = T.nnet.softmax(x) |
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
<ul class="list-group"> | |
<li class="list-group-item"><h4>Your Subscription(s)</h4></li> | |
{% set exists = [] %} | |
{% for sub in customer.subscriptions %} | |
{% if sub.store_id == store.id %} | |
{# This makes sure we know if we found a sub tied to the store #} | |
{% do exists.append(1) %} |
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
Python: | |
os.chdir(path) | |
cwd = os.getcwd() | |
print path | |
print cwd | |
print os.path.relpath(path, start=cwd) | |
output: | |
./themes/bold |
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 sqlalchemy as sqla | |
import sqlalchemy.ext.declarative as decl | |
from .signals import signaler | |
class _hooked(object): | |
def __init__(self, validate_func, normalize_func, field_name, private_name): | |
self.validate_func = validate_func | |
self.normalize_func = normalize_func | |
self.field_name = field_name |
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 numpy | |
import theano | |
import theano.tensor as T | |
def theano_softmax(): | |
x = T.dmatrix('x') | |
_y = T.nnet.softmax(x) | |
f = theano.function([x], _y) | |
return f |
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
var ChatRoom = function ChatRoom(chatList, inputArea, list) { | |
var _chatList = chatList, | |
_inputText = inputArea, | |
_userList = list, | |
_nickList = []; | |
/* | |
* Handle three events from the communications layer | |
*/ | |
this.expose = { |
NewerOlder