wissamantoun commited on
Commit
f8eb1e3
1 Parent(s): 248f94a
Files changed (1) hide show
  1. backend/aragpt.py +5 -5
backend/aragpt.py CHANGED
@@ -81,7 +81,7 @@ def write():
81
  help="The parameter for repetition penalty. 1.0 means no penalty",
82
  )
83
  no_repeat_ngram_size = st.sidebar.number_input(
84
- "No Repear N-Gram Size",
85
  min_value=0,
86
  value=3,
87
  help="If set to int > 0, all ngrams of that size can only occur once.",
@@ -161,14 +161,14 @@ def write():
161
  is_date = st.checkbox("Help the model: Is the answer a date?")
162
  if st.button("Answer"):
163
 
164
- prompt = qa_prompt + question + qa_prompt_post
165
  if is_date:
166
- prompt += qa_prompt_post_year
167
  else:
168
- prompt += " : "
169
  with st.spinner("Thinking..."):
170
  answer = generator.generate(
171
- prompt=prompt,
172
  model_name=model_name,
173
  max_new_tokens=max_new_tokens,
174
  temperature=temp,
 
81
  help="The parameter for repetition penalty. 1.0 means no penalty",
82
  )
83
  no_repeat_ngram_size = st.sidebar.number_input(
84
+ "No Repeat N-Gram Size",
85
  min_value=0,
86
  value=3,
87
  help="If set to int > 0, all ngrams of that size can only occur once.",
 
161
  is_date = st.checkbox("Help the model: Is the answer a date?")
162
  if st.button("Answer"):
163
 
164
+ prompt2 = qa_prompt + question + qa_prompt_post
165
  if is_date:
166
+ prompt2 += qa_prompt_post_year
167
  else:
168
+ prompt2 += " : "
169
  with st.spinner("Thinking..."):
170
  answer = generator.generate(
171
+ prompt=prompt2,
172
  model_name=model_name,
173
  max_new_tokens=max_new_tokens,
174
  temperature=temp,