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
""" | |
Rough PoC using binary search to find the optimal number of model layers to offload to the GPU, for this LLM and this hardware. | |
""" | |
import time | |
def call_llm(prompt, gpu_layers): | |
# TODO fill in the actual call to LLM here | |
# dummy GPU memory limit | |
test_best_layers = 60 |
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
/** | |
* Credits | |
* @Bkucera: https://github.com/cypress-io/cypress/issues/2839#issuecomment-447012818 | |
* @Phrogz: https://stackoverflow.com/a/10730777/1556245 | |
* | |
* Usage | |
* ``` | |
* // Types "foo" and then selects "fo" | |
* cy.get('input') | |
* .type('foo') |
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
def removeListDuplicates(seq): | |
seen = set() | |
seen_add = seen.add | |
return [ x for x in seq if x not in seen and not seen_add(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
#!/usr/bin/python | |
# Make sure file permission is set so that Owner, Group, and Everyone can EXECUTE. | |
# Otherwise server error | |
import os | |
import platform | |
print "Content-Type: text/html" | |
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 smtplib import SMTP_SSL | |
smtp = SMTP_SSL() | |
def emailUser(): | |
from_who_alias = 'Jarvis' | |
from_who_real = '[email protected]' | |
to = '[email protected]' | |
subject = 'Your Subject' | |
msg = 'Your message' |
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
# Actual Search URL takes the form of https://api.linkedin.com/v1/people-search:(people:(first-name,last-name))?keywords=apple%20microsoft | |
results = application.search_profile(selectors=[{'people': ['first-name', 'last-name', 'headline', 'id', 'location', 'public-profile-url']}], params={'keywords': 'apple microsoft'}) | |
profiles = [p for p in results['people']['values']] # returns the list of profiles only | |
# Set connection search limit. Start is the starting profile number, count is the number of profiles returned from the start number. In this case, it is 100. | |
application.get_connections(selectors=['headline', 'id','first-name', 'last-name','location'], params={'start':0, 'count':100}) | |
profiles = [p for p in results['people']['values']] # returns the list of profiles only | |
# As of late 2012, this only retrieves the app user's own full profile info, and will not fetch full profile features (i.e. SKILLS) of connections, only basic profile info. Calling this function without a member_id parameter will pull the |
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
Initial Gist Test | |
<div>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Molestiae, sit, reprehenderit qui labore ab aliquam officiis magnam optio esse voluptatum non libero vel praesentium! Vero qui et repellat itaque iusto.</div> | |
<div>Animi, cumque, neque voluptatum quod ea recusandae commodi maxime quae voluptate quis nihil nobis deserunt illo suscipit nostrum blanditiis impedit ipsum eaque dolor repellendus odit sapiente ipsam? Quae, et, voluptatem?</div> | |
<div>Omnis, vitae, quos, ipsum nulla iure accusantium tempore ex officiis corporis sint minima vero nihil aut suscipit sit fuga amet quia hic necessitatibus qui quas recusandae accusamus tempora in repellat.</div> | |
<div>Vel, possimus, ipsam, sapiente est minus dignissimos itaque dicta magni vero aut sed quia nobis omnis eveniet iste nulla maiores incidunt a quasi dolore ex iusto nihil fugit. Quaerat, quis.</div> | |
<div>Tempore, voluptates, quis dolor reprehenderit sunt vel eius delectus incidunt qui quasi animi provident sint labore sed natus. Volu |
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
# Currently for use with local flask server only -- See corresponding flask code snippet | |
from linkedin import linkedin | |
import requests | |
API_KEY = '' | |
API_SECRET = '' | |
OAUTH_TOKEN = '' | |
OAUTH_SECRET= '' | |
SCOPE = 'r_fullprofile%20r_network%20r_emailaddress%20r_contactinfo' |