Spaces:
Runtime error
Runtime error
Update rag.py
Browse files
rag.py
CHANGED
@@ -48,8 +48,16 @@ class ChatPDF:
|
|
48 |
# self.model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|
49 |
#
|
50 |
# https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha?library=true
|
51 |
-
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceH4/zephyr-7b-alpha")
|
52 |
-
self.model = AutoModelForCausalLM.from_pretrained("HuggingFaceH4/zephyr-7b-alpha")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
|
55 |
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1024, chunk_overlap=100)
|
|
|
48 |
# self.model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|
49 |
#
|
50 |
# https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha?library=true
|
51 |
+
# tokenizer = AutoTokenizer.from_pretrained("HuggingFaceH4/zephyr-7b-alpha")
|
52 |
+
# self.model = AutoModelForCausalLM.from_pretrained("HuggingFaceH4/zephyr-7b-alpha")
|
53 |
+
#
|
54 |
+
# https://huggingface.co/microsoft/phi-2?library=true
|
55 |
+
# Intended Uses
|
56 |
+
# Given the nature of the training data, the Phi-2 model is best suited for prompts using the
|
57 |
+
# QA format, the chat format, and the code format.
|
58 |
+
tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-2", trust_remote_code=True)
|
59 |
+
model = AutoModelForCausalLM.from_pretrained("microsoft/phi-2", trust_remote_code=True)
|
60 |
+
|
61 |
|
62 |
|
63 |
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1024, chunk_overlap=100)
|