Pratik Dwivedi commited on
Commit
9bf230a
·
1 Parent(s): 2db4593
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -38,7 +38,7 @@ def main():
38
 
39
  # keep the select box to llama as default but give a button right below it that says select model after which the model will be loaded
40
  st.sidebar.subheader("Select Model")
41
- model_name = st.sidebar.selectbox("Select Model", ["llama", "open_gpt4", "phi2", "mistral"])
42
  with st.spinner("Loading Model..."):
43
  prompter.load_model(model_name)
44
  st.success("Model Loaded!")
@@ -50,8 +50,12 @@ def main():
50
  with st.spinner("Generating response..."):
51
  for file in os.listdir(data_path):
52
  if file.endswith(".pdf"):
 
 
53
  source = prompter.add_source_document(data_path, file, query=None)
 
54
  responses = prompter.prompt_with_source(query, prompt_name="just_the_facts", temperature=0.3)
 
55
  for r, response in enumerate(responses):
56
  print(query, ":", re.sub("[\n]"," ", response["llm_response"]).strip())
57
  prompter.clear_source_materials()
 
38
 
39
  # keep the select box to llama as default but give a button right below it that says select model after which the model will be loaded
40
  st.sidebar.subheader("Select Model")
41
+ model_name = st.sidebar.selectbox("Select Model", ["phi2", "open_gpt4", "mistral", "llama"])
42
  with st.spinner("Loading Model..."):
43
  prompter.load_model(model_name)
44
  st.success("Model Loaded!")
 
50
  with st.spinner("Generating response..."):
51
  for file in os.listdir(data_path):
52
  if file.endswith(".pdf"):
53
+ print("Found PDF file: ", file)
54
+ print("loading Source...")
55
  source = prompter.add_source_document(data_path, file, query=None)
56
+ print("generating response...")
57
  responses = prompter.prompt_with_source(query, prompt_name="just_the_facts", temperature=0.3)
58
+ print("response generated!")
59
  for r, response in enumerate(responses):
60
  print(query, ":", re.sub("[\n]"," ", response["llm_response"]).strip())
61
  prompter.clear_source_materials()