Skip to content

Instantly share code, notes, and snippets.

View idontcalculate's full-sized avatar
🫘
magic

Sirius1389 idontcalculate

🫘
magic
View GitHub Profile
query_engine_tools = [
QueryEngineTool(
query_engine=tesla_engine,
metadata=ToolMetadata(
name="tesla_tool",
description=(
"Provides information about Teslas predictions for future "
"Use a detailed plain text question as input to the tool."
),
),
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"],