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
import gradio as gr | |
import google.generativeai as genai | |
apikey = 'xxx' # Replace with your key | |
genai.configure(api_key=apikey) | |
with gr.Blocks() as demo: | |
chatbot = gr.Chatbot() | |
msg = gr.Textbox() | |
clear = gr.ClearButton([msg, chatbot]) |
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
import gradio as gr | |
import google.generativeai as genai | |
apikey = 'xxx' # Replace with your key | |
genai.configure(api_key=apikey) | |
with gr.Blocks() as demo: | |
chatbot = gr.Chatbot() | |
msg = gr.Textbox() |
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
import gradio as gr | |
from openai import OpenAI | |
import docx2txt | |
from langchain.document_loaders import TextLoader | |
from langchain.vectorstores import FAISS | |
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
from langchain.document_loaders import PyPDFLoader | |
from langchain.document_loaders import Docx2txtLoader | |
import os | |
from langchain.embeddings import OpenAIEmbeddings |
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
import gradio as gr | |
from openai import OpenAI | |
import docx2txt | |
import PyPDF2 | |
api_key = "sk-" # Replace with your key | |
def read_text_from_file(file_path): | |
# Check the file type and read accordingly |
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
import gradio as gr | |
from openai import OpenAI | |
api_key = "sk-" # Replace with your key | |
with gr.Blocks() as demo: | |
chatbot = gr.Chatbot() | |
msg = gr.Textbox() | |
clear = gr.Button("Clear") | |
filename = gr.File() |
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
import gradio as gr | |
from openai import OpenAI | |
api_key = "sk-" # Replace with your key | |
with gr.Blocks() as demo: | |
chatbot = gr.Chatbot() | |
msg = gr.Textbox() | |
clear = gr.Button("Clear") |
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
import gradio as gr | |
from openai import OpenAI | |
api_key = "sk-" # Replace with your key | |
with gr.Blocks() as demo: | |
chatbot = gr.Chatbot() | |
msg = gr.Textbox() | |
clear = gr.ClearButton([msg, chatbot]) |
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
import gradio as gr | |
from openai import OpenAI | |
import docx2txt | |
import PyPDF2 | |
api_key = "sk-" # Replace with your key | |
def read_text_from_file(file_path): | |
# Check the file type and read accordingly |
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
import requests | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
def matchbymatch(id): | |
urlformat = 'https://stats.espncricinfo.com/ci/engine/player/{}.html?class=2;template=results;type=allround;view=match'.format(id) | |
page = requests.get(urlformat) | |
bs = BeautifulSoup(page.content, 'lxml') | |
rows = bs.find_all('tr',class_='data1') | |
data = [] |
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
import os | |
from io import BytesIO | |
import tarfile | |
import tempfile | |
from six.moves import urllib | |
from matplotlib import gridspec | |
from matplotlib import pyplot as plt | |
import numpy as np | |
from PIL import Image |
NewerOlder