bstraehle commited on
Commit
b1fd4a2
·
1 Parent(s): ac4cc68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -22,12 +22,9 @@ template = """Use the following pieces of context to answer the question at the
22
 
23
  QA_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"], template = template)
24
 
25
- print(os.listdir("docs/chroma/"))
26
- print(os.listdir("docs/youtube/"))
27
-
28
  def invoke(openai_api_key, youtube_url, prompt):
29
  openai.api_key = openai_api_key
30
- if (len(os.listdir("docs/chroma/")) == 0):
31
  youtube_dir = "docs/youtube/"
32
  loader = GenericLoader(YoutubeAudioLoader([youtube_url], youtube_dir), OpenAIWhisperParser())
33
  docs = loader.load()
 
22
 
23
  QA_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"], template = template)
24
 
 
 
 
25
  def invoke(openai_api_key, youtube_url, prompt):
26
  openai.api_key = openai_api_key
27
+ if (os.path.isdir("docs/chroma/")):
28
  youtube_dir = "docs/youtube/"
29
  loader = GenericLoader(YoutubeAudioLoader([youtube_url], youtube_dir), OpenAIWhisperParser())
30
  docs = loader.load()