Spaces:
Runtime error
Runtime error
organized import statements
Browse files
app.py
CHANGED
@@ -3,31 +3,27 @@ import boto3
|
|
3 |
from botocore import UNSIGNED
|
4 |
from botocore.client import Config
|
5 |
|
6 |
-
from langchain.document_loaders import WebBaseLoader
|
7 |
|
8 |
from huggingface_hub import AsyncInferenceClient
|
9 |
|
10 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
11 |
|
12 |
-
|
13 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
14 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_size=350, chunk_overlap=10)
|
15 |
-
|
16 |
from langchain.llms import HuggingFaceHub
|
17 |
-
model_id = HuggingFaceHub(repo_id="HuggingFaceH4/zephyr-7b-beta", model_kwargs={"temperature":0.1, "max_new_tokens":300})
|
18 |
-
|
19 |
from langchain.embeddings import HuggingFaceHubEmbeddings
|
20 |
-
embeddings = HuggingFaceHubEmbeddings()
|
21 |
-
|
22 |
from langchain.vectorstores import Chroma
|
23 |
-
|
24 |
from langchain.chains import RetrievalQA
|
25 |
-
|
26 |
from langchain.prompts import ChatPromptTemplate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
#web_links = ["https://www.databricks.com/","https://help.databricks.com","https://docs.databricks.com","https://kb.databricks.com/","http://docs.databricks.com/getting-started/index.html","http://docs.databricks.com/introduction/index.html","http://docs.databricks.com/getting-started/tutorials/index.html","http://docs.databricks.com/machine-learning/index.html","http://docs.databricks.com/sql/index.html"]
|
29 |
-
#loader = WebBaseLoader(web_links)
|
30 |
-
#documents = loader.load()
|
31 |
|
32 |
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))
|
33 |
s3.download_file('rad-rag-demos', 'vectorstores/chroma.sqlite3', './chroma_db/chroma.sqlite3')
|
|
|
3 |
from botocore import UNSIGNED
|
4 |
from botocore.client import Config
|
5 |
|
|
|
6 |
|
7 |
from huggingface_hub import AsyncInferenceClient
|
8 |
|
9 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
10 |
|
|
|
11 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
|
|
|
12 |
from langchain.llms import HuggingFaceHub
|
|
|
|
|
13 |
from langchain.embeddings import HuggingFaceHubEmbeddings
|
|
|
|
|
14 |
from langchain.vectorstores import Chroma
|
|
|
15 |
from langchain.chains import RetrievalQA
|
|
|
16 |
from langchain.prompts import ChatPromptTemplate
|
17 |
+
from langchain.document_loaders import WebBaseLoader
|
18 |
+
|
19 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=350, chunk_overlap=10)
|
20 |
+
|
21 |
+
|
22 |
+
model_id = HuggingFaceHub(repo_id="HuggingFaceH4/zephyr-7b-beta", model_kwargs={"temperature":0.1, "max_new_tokens":300})
|
23 |
+
|
24 |
+
|
25 |
+
embeddings = HuggingFaceHubEmbeddings()
|
26 |
|
|
|
|
|
|
|
27 |
|
28 |
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))
|
29 |
s3.download_file('rad-rag-demos', 'vectorstores/chroma.sqlite3', './chroma_db/chroma.sqlite3')
|