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 functools | |
import jax | |
import numpy as np | |
import jax.numpy as jnp | |
from sentence_transformers import SentenceTransformer | |
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2') | |
model = model.to("cpu") | |
sentences = [ |
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
diff --git a/llms/mistral/mistral.py b/llms/mistral/mistral.py | |
index 9b9a602..5fd5146 100644 | |
--- a/llms/mistral/mistral.py | |
+++ b/llms/mistral/mistral.py | |
@@ -144,6 +144,7 @@ class Mistral(nn.Module): | |
self.layers = [TransformerBlock(args=args) for _ in range(args.n_layers)] | |
self.norm = RMSNorm(args.dim, eps=args.norm_eps) | |
self.output = nn.Linear(args.dim, args.vocab_size, bias=False) | |
+ self.ilayers = list(range(len(self.layers))) | |
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 time | |
import objc | |
from Foundation import NSObject, NSRunLoop, NSDate | |
import AVFoundation | |
import Cocoa | |
# https://gitlab.com/gltd/say-cocoa/-/blob/master/test.py?ref_type=heads | |
def main1(): | |
class SpeechSynthesizerDelegate(NSObject): |
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 datetime import datetime, timedelta | |
from Speech import SFSpeechRecognizer, SFSpeechAudioBufferRecognitionRequest | |
from AppKit import NSRunLoop | |
from PyObjCTools import AppHelper | |
import AVFoundation | |
# https://developer.apple.com/documentation/speech/recognizing_speech_in_live_audio |
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
import rich | |
from Foundation import NSObject, NSRunLoop, NSDefaultRunLoopMode, NSDate, NSArray | |
from CoreBluetooth import CBCentralManager, CBCentralManagerStatePoweredOn, CBUUID | |
import time | |
state = {} | |
# Create a delegate to handle CoreBluetooth events |
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> | |
<meta charset="UTF-8"> | |
<title>Accelerometer Data</title> | |
<script src="https://d3js.org/d3.v7.min.js"></script> | |
<style> | |
body { | |
display: flex; | |
flex-direction: column; |
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>Accelerometer Data</title> | |
</head> | |
<body> | |
<div id="accelerometerData"> | |
<p>Acceleration X: <span id="accelerationX"></span></p> | |
<p>Acceleration Y: <span id="accelerationY"></span></p> |
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 sys | |
import time | |
import objc | |
from ScriptingBridge import SBApplication | |
import Foundation | |
import AppKit | |
# Hide python rocket ship from popping up in Dock when run. | |
import AppKit |
NewerOlder