Skip to content

Instantly share code, notes, and snippets.

View idontcalculate's full-sized avatar
👾

Sirius1389 idontcalculate

👾
View GitHub Profile
from langchain.llms import OpenAI
from langchain.docstore.wikipedia import Wikipedia
from langchain.agents.react.base import DocstoreExplorer
from langchain.agents import Tool
from langchain.agents import initialize_agent
docstore = DocstoreExplorer(Wikipedia())
tools = [
Tool(

> Entering new AgentExecutor chain...Thought: I need to search Japan and find its capitol. Action: Search[Japan] Observation: ***Japan (Japanese: 日本, Nippon or Nihon, and formally 日本国, Nihonkoku) is an island country in East Asia. It is situated in the northwest Pacific Ocean and is bordered on the west by the Sea of Japan, extending from the Sea of Okhotsk in the north toward the East China Sea, Philippine Sea, and Taiwan in the south. Japan is a part of the Ring of Fire, and spans an archipelago of 14,125 islands, with the five main islands being Hokkaido, Honshu (the "mainland"), Shikoku, Kyushu, and Okinawa. Tokyo is the nation's capital and largest city, followed by Yokohama, Osaka, Nagoya, Sapporo, Fukuoka, Kobe, and Kyoto. Japan is the eleventh most populous country in the world, as well as one of the most densely populated and urbanized. About three-fourths of the country's terrain is mountainous, concentrating its population of almost 125 million on narrow coastal plains. Japan is divided into

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

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 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"

import os
os.environ["OPENAI_API_KEY"] = "your openai key"
from embedchain import App
bench_bot = App()
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/')
# 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')
#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
answer = bench_bot.query('how to submit benchmarks?')
print(answer)