Kelvinhjk commited on
Commit
cc21bae
·
1 Parent(s): 984eecc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -5,6 +5,7 @@ from langchain.embeddings.openai import OpenAIEmbeddings
5
  from langchain.text_splitter import CharacterTextSplitter
6
  from langchain.vectorstores import FAISS
7
  from transformers import TFAutoModelForQuestionAnswering, AutoTokenizer, pipeline
 
8
 
9
  os.environ["OPENAI_API_KEY"] = "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"
10
 
@@ -73,12 +74,12 @@ with st.sidebar:
73
  selected = option_menu("Model selection", ["Roberta base squad2", "Bert finetuned squad"],
74
  icons=['box-fill', 'box-fill'], menu_icon="cast", default_index=0)
75
 
76
-
 
77
  st.markdown('<p class="big-font">QnA for Swinburne\'s Bachelor of Computer Science progrom</p>', unsafe_allow_html=True)
 
78
 
79
  if selected == "Roberta base squad2":
80
-
81
- st.write("- ", selected)
82
  text0 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?):")
83
  if text0:
84
  #######
@@ -91,8 +92,6 @@ if selected == "Roberta base squad2":
91
 
92
 
93
  elif selected == "Bert finetuned squad":
94
- st.markdown('<p class="big-font">QnA for Swinburne\'s Bachelor of Computer Science progrom</p>', unsafe_allow_html=True)
95
- st.write("- ", selected)
96
  text1 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?): ")
97
  if text1:
98
  # Fed in the question to the model
 
5
  from langchain.text_splitter import CharacterTextSplitter
6
  from langchain.vectorstores import FAISS
7
  from transformers import TFAutoModelForQuestionAnswering, AutoTokenizer, pipeline
8
+ from PIL import Image
9
 
10
  os.environ["OPENAI_API_KEY"] = "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"
11
 
 
74
  selected = option_menu("Model selection", ["Roberta base squad2", "Bert finetuned squad"],
75
  icons=['box-fill', 'box-fill'], menu_icon="cast", default_index=0)
76
 
77
+ image = Image.open('Swinburne_Logo.png')
78
+ st.image(image)
79
  st.markdown('<p class="big-font">QnA for Swinburne\'s Bachelor of Computer Science progrom</p>', unsafe_allow_html=True)
80
+ st.write("- ", selected)
81
 
82
  if selected == "Roberta base squad2":
 
 
83
  text0 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?):")
84
  if text0:
85
  #######
 
92
 
93
 
94
  elif selected == "Bert finetuned squad":
 
 
95
  text1 = st.text_area("Type question (Eg. What is the duration of the Bachelor of Computer Science program?): ")
96
  if text1:
97
  # Fed in the question to the model