Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -85,21 +85,8 @@ def ragChain():
|
|
85 |
vectorstore = FAISS.from_documents(documents = docs, embedding = HuggingFaceEmbeddings())
|
86 |
retriever = vectorstore.as_retriever(search_type = "similarity", search_kwargs = {"k": 5})
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
model = transformers.AutoModelForCausalLM.from_pretrained(
|
91 |
-
'mosaicml/mpt-1b-redpajama-200b',
|
92 |
-
trust_remote_code=True,
|
93 |
-
)
|
94 |
-
model.eval()
|
95 |
-
tokenizer = transformers.AutoTokenizer.from_pretrained("mosaicml/mpt-30b")
|
96 |
-
|
97 |
-
generate_text = transformers.pipeline(
|
98 |
-
model=model,
|
99 |
-
tokenizer=tokenizer,
|
100 |
-
return_full_text=True,
|
101 |
-
)
|
102 |
-
llm = HuggingFacePipeline(pipeline=generate_text)
|
103 |
|
104 |
prompt = ChatPromptTemplate.from_messages(
|
105 |
[
|
|
|
85 |
vectorstore = FAISS.from_documents(documents = docs, embedding = HuggingFaceEmbeddings())
|
86 |
retriever = vectorstore.as_retriever(search_type = "similarity", search_kwargs = {"k": 5})
|
87 |
|
88 |
+
api_key = os.getenv("APIKEY")
|
89 |
+
llm = ChatFireworks(model="accounts/fireworks/models/mixtral-8x7b-instruct", api_key = api_key)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
prompt = ChatPromptTemplate.from_messages(
|
92 |
[
|