Skip to content

Instantly share code, notes, and snippets.

View idontcalculate's full-sized avatar
🫘
magic

Sirius1389 idontcalculate

🫘
magic
View GitHub Profile
import llama_index
from llama_index.tools import QueryEngineTool, ToolMetadata
from llama_index import (
SimpleDirectoryReader,
VectorStoreIndex,
StorageContext,
load_index_from_storage,
)
try:
@bot.command()
async def dogsplain(ctx, *, question: str):
print(f"User: {ctx.author.name}, Query: {question}")
try:
response = chat_bot.query(question)
await send_response(ctx, response)
except Exception as e:
await send_response(ctx, "An error occurred. Please try again!")
print("Error occurred during 'query' command:", e)
answer = bench_bot.query('how to submit benchmarks?')
print(answer)
#pdf data arxiv on bench
bench_bot.add('https://arxiv.org/pdf/2207.10062.pdf', data_type='pdf_file')
#notion page data
bench_bot.add('https://signalism.notion.site/MLCommons-An-In-Depth-Whitepaper-on-Benchmarking-Machine-Learning-Performance-d21aabe85304439fb5ae4ca7ac3826f7?pvs=4')
#docs
bench_bot.add('https://docs.google.com/spreadsheets/d/1bF4buOnEPQcwoqlaSeX4HxKx8jVRR0xHcOT_CaAL5Mk/pubhtml?gid=0&single=false&widget=false&headers=false&chrome=true', data_type="docs_site")
#github as page
# takes the transcript and load it with yt_loader ;)
bench_bot.add('youtube_video', 'https://www.youtube.com/watch?v=uMNtTBRCHXA')
bench_bot.add('youtube_video', 'https://www.youtube.com/watch?v=eyK-9UehYPo')
bench_bot.add('youtube_video', 'https://www.youtube.com/watch?v=woGaG3ZcTbU')
bench_bot.add('youtube_video', 'https://www.youtube.com/watch?v=woGaG3ZcTbU')
bench_bot.add('youtube_video', 'https://www.youtube.com/watch?v=txtvMhzEDu8')
bench_bot.add('web_page', 'https://mlcommons.org/en/training-normal-30/')
bench_bot.add('web_page', 'https://mlcommons.org/en/training-hpc-20/')
bench_bot.add('web_page', 'https://mlcommons.org/en/inference-datacenter-30/')
bench_bot.add('web_page', 'https://mlcommons.org/en/inference-tiny-11/')
bench_bot.add('web_page', 'https://mlcommons.org/en/groups/datasets/')
import os
os.environ["OPENAI_API_KEY"] = "your openai key"
from embedchain import App
bench_bot = App()

Entering new AgentExecutor chain... I need to calculate the time between now and the next Solar eclipse Action: Wolfram Alpha Action Input: "When is the next Solar eclipse" Observation: ?

The next solar eclipse will occur on December 14, 2020. It will be an annular eclipse visible from parts of South America, the South Pacific, and the southern Atlantic Ocean. Thought: I need to calculate the number of days between now and December 14, 2020 Action: Wolfram Alpha Action Input: "How many days until December 14, 2020"

from langchain.llms import OpenAI
from langchain.agents import Tool
from langchain.utilities import GoogleSearchAPIWrapper
from langchain.prompts import PromptTemplate
from langchain.chains import LLMChain
from langchain.agents import initialize_agent
llm = OpenAI(temperature=0)
prompt = PromptTemplate(
input_variables=["query"],

Entering new AgentExecutor chain... I need to find out what caused Napoleon to change his plans. Action: Search Action Input: Reasons why Napoleon abandoned plans to invade England Observation: May 6, 2021 ... Napoleon's planned invasion of England: what went wrong? On 2 December 1804, Napoleon Bonaparte was crowned Emperor of France, and his ... The first French Army of England had gathered on the Channel coast in 1798, but an invasion of England was sidelined by Napoleon's concentration on ... Jun 22, 2012 ... In late July, the Russians similarly abandoned Vitebsk, setting fire to military stores and a bridge on their way out. Then, in mid-August, they ... The French invasion of Russia, also known as the Russian campaign, the Second Polish War, ... However, nothing was to go as planned, because Napoleon had failed to ... Napoleon's invasion of Russia in 1812, eternalized in Tolstoy's War and Peace, ... Napoleon's Russian campaign was well planned and supplied. May 15, 2014 ... Throughout this period, E