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
import torch.nn.functional as F | |
import torch | |
import torch.nn as nn | |
class MultiHeadAttention(nn.Module): | |
def __init__(self, dim_in, dim_out, context_length, dropout, num_heads): | |
super().__init__() | |
assert dim_out % num_heads == 0, "dim_out must be divisible by num_heads" | |
self.num_heads = num_heads |
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
<?php | |
$completion = ""; | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { | |
// Your OpenAI API key | |
$apiKey = ''; | |
// The message you want to send to OpenAI | |
$message = $_POST['message']; |
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
foreign | |
did the gpd4 developer demo live stream | |
honestly it's kind of hard for me to | |
believe that this day is here open AI | |
has been building this technology really | |
since we started the company but for the | |
past two years we've been really focused | |
on delivering gpt4 | |
that started with rebuilding our entire | |
training stack actually training the |
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
Py4JJavaError: An error occurred while calling o100.json. | |
: com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.ProvisionException: Unable to provision, see the following errors: | |
1) Error in custom provider, java.lang.NoClassDefFoundError: MyAWSCredentialsProviderWithUri$1 | |
at com.amazon.ws.emr.hadoop.fs.guice.EmrFSBaseModule.provideAmazonS3Lite(EmrFSBaseModule.java:112) | |
at com.amazon.ws.emr.hadoop.fs.guice.EmrFSBaseModule.provideAmazonS3Lite(EmrFSBaseModule.java:112) | |
while locating com.amazon.ws.emr.hadoop.fs.s3.lite.AmazonS3Lite | |
for field at com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem.s3(S3NativeFileSystem.java:92) | |
while locating com.amazon.ws.emr.hadoop.fs.s3n.S3NativeFileSystem | |
while locating org.apache.hadoop.fs.FileSystem annotated with @com.amazon.ws.emr.hadoop.fs.shaded.com.google.inject.name.Named(value=s3n) |
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
import traceback | |
import pendulum | |
import pymysql | |
from pymysql.protocol import MysqlPacket | |
from pymysqlreplication.binlogstream import MYSQL_EXPECTED_ERROR_CODES | |
from pymysqlreplication.constants import * | |
from pymysqlreplication.event import * | |
from pymysqlreplication.packet import BinLogPacketWrapper | |
from pymysqlreplication.row_event import TableMapEvent, UpdateRowsEvent, WriteRowsEvent, DeleteRowsEvent |
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
# this is a partial code | |
# skip to 462 | |
# https://dev.mysql.com/doc/internals/en/query-event.html | |
file_pointer = 462 | |
print("==================") | |
print("file_pointer", file_pointer) | |
f.seek(file_pointer) | |
header = Header() | |
header.unpack(f.read(header_length)) | |
file_pointer += header_length |
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
import struct | |
import pendulum | |
class Header: | |
def __init__(self): | |
self.timestamp = 0 | |
self.event_type = None | |
self.server_id = None | |
self.event_size = 0 |
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
import struct | |
with open("person.bin", 'rb') as f: | |
while True: | |
data = f.read(72) | |
if not data: | |
break | |
unpacked = struct.unpack('<II32s32s', data) | |
print(f"ID:{unpacked[0]} " | |
f"Age:{unpacked[1]} " |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct | |
{ | |
int id; | |
uint32_t age; | |
char firstName[32]; | |
char lastName[32]; |
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
import struct | |
bin_log_file = "mysql-bin-changelog.000050.bin" | |
file_pointer = 0 | |
with open(bin_log_file, 'rb') as f: | |
magic = f.read(4) | |
# 0xfe, 0x62, 0x69, 0x6e | |
assert magic == b"\xfe\x62\x69\x6e" | |
# or |
NewerOlder