huriacane33 commited on
Commit
1a3cbfb
·
verified ·
1 Parent(s): d25636a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -3,16 +3,16 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
3
  import pandas as pd
4
  import re
5
 
6
- # Load the LLaMA model and tokenizer
7
  @st.cache_resource
8
- def load_llama_model():
9
- """Load the LLaMA model and tokenizer."""
10
- model_name = "meta-llama/Llama-2-7b-chat-hf" # Replace with your preferred LLaMA model
11
  tokenizer = AutoTokenizer.from_pretrained(model_name)
12
  model = AutoModelForCausalLM.from_pretrained(model_name)
13
  return pipeline("text-generation", model=model, tokenizer=tokenizer)
14
 
15
- qa_pipeline = load_llama_model()
16
 
17
  # Load SOP Dataset
18
  @st.cache_data
@@ -39,7 +39,7 @@ def find_best_context(question, dataset):
39
  return best_context
40
 
41
  # Streamlit UI
42
- st.title("SOP Question Answering AI with LLaMA")
43
  st.markdown("Ask any question about Standard Operating Procedures:")
44
 
45
  # User input
 
3
  import pandas as pd
4
  import re
5
 
6
+ # Load the Falcon-7B-Instruct model and tokenizer
7
  @st.cache_resource
8
+ def load_falcon_model():
9
+ """Load the Falcon-7B-Instruct model and tokenizer."""
10
+ model_name = "tiiuae/falcon-7b-instruct" # Open model for instruction-based tasks
11
  tokenizer = AutoTokenizer.from_pretrained(model_name)
12
  model = AutoModelForCausalLM.from_pretrained(model_name)
13
  return pipeline("text-generation", model=model, tokenizer=tokenizer)
14
 
15
+ qa_pipeline = load_falcon_model()
16
 
17
  # Load SOP Dataset
18
  @st.cache_data
 
39
  return best_context
40
 
41
  # Streamlit UI
42
+ st.title("SOP Question Answering AI with Falcon")
43
  st.markdown("Ask any question about Standard Operating Procedures:")
44
 
45
  # User input