Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
|
4 |
from langchain.chains import RetrievalQA
|
5 |
from langchain.chat_models import ChatOpenAI
|
@@ -22,8 +22,10 @@ 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 |
-
|
26 |
-
|
|
|
|
|
27 |
|
28 |
MODEL_NAME = "gpt-4"
|
29 |
|
|
|
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
|
|
|
22 |
|
23 |
QA_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"], template = template)
|
24 |
|
25 |
+
rng = random.randrange(1000000).str()
|
26 |
+
|
27 |
+
CHROMA_DIR = "docs/chroma" + rng
|
28 |
+
YOUTUBE_DIR = "docs/youtube" + rng
|
29 |
|
30 |
MODEL_NAME = "gpt-4"
|
31 |
|