bstraehle commited on
Commit
f4087b0
1 Parent(s): b0371ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -1,20 +1,20 @@
1
  import gradio as gr
2
- import langchain, openai, os, random, shutil
3
 
4
- #from langchain.chains import RetrievalQA
5
- #from langchain.chat_models import ChatOpenAI
6
- #from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader
7
- #from langchain.document_loaders.generic import GenericLoader
8
- #from langchain.document_loaders.parsers import OpenAIWhisperParser
9
- #from langchain.embeddings.openai import OpenAIEmbeddings
10
- #from langchain.prompts import PromptTemplate
11
- #from langchain.text_splitter import RecursiveCharacterTextSplitter
12
- #from langchain.vectorstores import Chroma
13
 
14
  from dotenv import load_dotenv, find_dotenv
15
  _ = load_dotenv(find_dotenv())
16
 
17
- #openai.api_key = os.environ["OPENAI_API_KEY"]
18
 
19
  template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up
20
  an answer. Keep the answer as concise as possible. Always say "🔥 Thanks for using the app - Bernd Straehle." at the end of the answer.
 
1
  import gradio as gr
2
+ import openai, os, random, shutil
3
 
4
+ from langchain.chains import RetrievalQA
5
+ from langchain.chat_models import ChatOpenAI
6
+ from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader
7
+ from langchain.document_loaders.generic import GenericLoader
8
+ from langchain.document_loaders.parsers import OpenAIWhisperParser
9
+ from langchain.embeddings.openai import OpenAIEmbeddings
10
+ from langchain.prompts import PromptTemplate
11
+ from langchain.text_splitter import RecursiveCharacterTextSplitter
12
+ from langchain.vectorstores import Chroma
13
 
14
  from dotenv import load_dotenv, find_dotenv
15
  _ = load_dotenv(find_dotenv())
16
 
17
+ openai.api_key = "" #os.environ["OPENAI_API_KEY"]
18
 
19
  template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up
20
  an answer. Keep the answer as concise as possible. Always say "🔥 Thanks for using the app - Bernd Straehle." at the end of the answer.