Spaces:
Runtime error
Runtime error
gkrthk
commited on
Commit
•
e769925
1
Parent(s):
341abc7
fix
Browse files- confluence_qa.py +3 -3
confluence_qa.py
CHANGED
@@ -12,8 +12,8 @@ class ConfluenceQA:
|
|
12 |
self.embeddings = HuggingFaceEmbeddings(model_name="multi-qa-MiniLM-L6-cos-v1")
|
13 |
|
14 |
def define_model(self) -> None:
|
15 |
-
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-
|
16 |
-
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-
|
17 |
pipe = pipeline("text2text-generation", model=model, tokenizer=tokenizer,max_new_tokens=1024)
|
18 |
self.llm = HuggingFacePipeline(pipeline = pipe,model_kwargs={"temperature": 0.5})
|
19 |
|
@@ -28,7 +28,7 @@ class ConfluenceQA:
|
|
28 |
url=confluence_url, username=username, api_key=api_key
|
29 |
)
|
30 |
documents = loader.load(include_attachments=include_attachment, limit=100, space_key=space_key)
|
31 |
-
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=
|
32 |
documents = text_splitter.split_documents(documents)
|
33 |
self.db = Chroma.from_documents(documents, self.embeddings)
|
34 |
# question = "How do I make a space public?"
|
|
|
12 |
self.embeddings = HuggingFaceEmbeddings(model_name="multi-qa-MiniLM-L6-cos-v1")
|
13 |
|
14 |
def define_model(self) -> None:
|
15 |
+
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xxl")
|
16 |
+
model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xxl")
|
17 |
pipe = pipeline("text2text-generation", model=model, tokenizer=tokenizer,max_new_tokens=1024)
|
18 |
self.llm = HuggingFacePipeline(pipeline = pipe,model_kwargs={"temperature": 0.5})
|
19 |
|
|
|
28 |
url=confluence_url, username=username, api_key=api_key
|
29 |
)
|
30 |
documents = loader.load(include_attachments=include_attachment, limit=100, space_key=space_key)
|
31 |
+
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)
|
32 |
documents = text_splitter.split_documents(documents)
|
33 |
self.db = Chroma.from_documents(documents, self.embeddings)
|
34 |
# question = "How do I make a space public?"
|