Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,7 @@ from langchain.llms import LlamaCpp
|
|
| 11 |
from langchain.prompts import PromptTemplate
|
| 12 |
import os
|
| 13 |
import pandas as pd
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
prompt_template_questions = """
|
|
@@ -89,13 +90,13 @@ if file_path:
|
|
| 89 |
# Initialize Large Language Model for question generation
|
| 90 |
llm_question_gen = LlamaCpp(
|
| 91 |
streaming = True,
|
| 92 |
-
model_path=
|
| 93 |
temperature=0.75,
|
| 94 |
top_p=1,
|
| 95 |
verbose=True,
|
| 96 |
n_ctx=4096
|
| 97 |
)
|
| 98 |
-
|
| 99 |
# Initialize question generation chain
|
| 100 |
question_gen_chain = load_summarize_chain(llm=llm_question_gen, chain_type="refine", verbose=True,
|
| 101 |
question_prompt=PROMPT_QUESTIONS, refine_prompt=REFINE_PROMPT_QUESTIONS)
|
|
@@ -105,7 +106,7 @@ if file_path:
|
|
| 105 |
# Initialize Large Language Model for answer generation
|
| 106 |
llm_answer_gen = LlamaCpp(
|
| 107 |
streaming = True,
|
| 108 |
-
model_path="zephyr-
|
| 109 |
temperature=0.75,
|
| 110 |
top_p=1,
|
| 111 |
verbose=True,
|
|
|
|
| 11 |
from langchain.prompts import PromptTemplate
|
| 12 |
import os
|
| 13 |
import pandas as pd
|
| 14 |
+
from transformers import AutoModel
|
| 15 |
|
| 16 |
|
| 17 |
prompt_template_questions = """
|
|
|
|
| 90 |
# Initialize Large Language Model for question generation
|
| 91 |
llm_question_gen = LlamaCpp(
|
| 92 |
streaming = True,
|
| 93 |
+
model_path = AutoModel.from_pretrained("TheBloke/zephyr-7B-beta-GGUF"),
|
| 94 |
temperature=0.75,
|
| 95 |
top_p=1,
|
| 96 |
verbose=True,
|
| 97 |
n_ctx=4096
|
| 98 |
)
|
| 99 |
+
model = AutoModel.from_pretrained("TheBloke/zephyr-7B-beta-GGUF")
|
| 100 |
# Initialize question generation chain
|
| 101 |
question_gen_chain = load_summarize_chain(llm=llm_question_gen, chain_type="refine", verbose=True,
|
| 102 |
question_prompt=PROMPT_QUESTIONS, refine_prompt=REFINE_PROMPT_QUESTIONS)
|
|
|
|
| 106 |
# Initialize Large Language Model for answer generation
|
| 107 |
llm_answer_gen = LlamaCpp(
|
| 108 |
streaming = True,
|
| 109 |
+
model_path = AutoModel.from_pretrained("TheBloke/zephyr-7B-beta-GGUF"),
|
| 110 |
temperature=0.75,
|
| 111 |
top_p=1,
|
| 112 |
verbose=True,
|