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
# https://python.langchain.com/docs/modules/model_io/models/llms/integrations/llamacpp | |
import os | |
from langchain import PromptTemplate, LLMChain | |
from langchain.llms import LlamaCpp | |
from langchain import PromptTemplate, LLMChain | |
from langchain.callbacks.manager import CallbackManager | |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler | |
template = """Question: {question} |
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 asyncio | |
import aiohttp | |
import time | |
async def get(url, session): | |
try: | |
async with session.get(url=url) as response: | |
resp = await response.read() | |
print("Successfully got url {} with resp of length {}.".format(url, len(resp))) |
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
public async Task<DataResponse> GetAsync(string uri, List<KeyValuePair<string, string>> formValues) { | |
try { | |
var auth = new AuthenticationHeaderValue("Basic", | |
Convert.ToBase64String(Encoding.UTF8.GetBytes( | |
$"{HttpUtility.UrlEncode(_clientId)}:{HttpUtility.UrlEncode(_clientSecret)}"))); | |
var request = new HttpRequestMessage(HttpMethod.Post, uri) { | |
Headers = { Authorization = auth }, | |
Content = new FormUrlEncodedContent(formValues) | |
}; | |
using var response = await HttpClient.SendAsync(request); |
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 requests | |
import json | |
import jwt | |
from dotenv import dotenv_values | |
def get_json(endpoint: str): | |
response = requests.get(endpoint) | |
response.raise_for_status() | |
return json.loads(response.content) |
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
from machine import Pin,I2C,SPI,PWM,ADC | |
import framebuf | |
import time | |
import math | |
DC = 8 | |
CS = 9 | |
SCK = 10 | |
MOSI = 11 |
OlderNewer