xzyao commited on
Commit
b2d556d
1 Parent(s): 40403b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -6,7 +6,7 @@ from datetime import datetime
6
 
7
  def to_md(text):
8
  # return text.replace("\n", "<br />")
9
- return text
10
 
11
  @st.cache
12
  def infer(
@@ -18,7 +18,7 @@ def infer(
18
  top_k=40,
19
  num_completions=1,
20
  seed=42,
21
- stop="."
22
  ):
23
  model_name_map = {
24
  "GPT-JT-6B-v1": "Together-gpt-JT-6B-v1",
@@ -130,7 +130,7 @@ def main():
130
  top_p = st.text_input('top_p', st.session_state.top_p)
131
  # num_completions = st.text_input('num_completions (only the best one will be returend)', "1")
132
  num_completions = "1"
133
- stop = st.text_input('stop, split by;', r'.')
134
  # seed = st.text_input('seed', "42")
135
  seed = "42"
136
 
@@ -163,7 +163,6 @@ def main():
163
  prompt, model_name=model_name, max_new_tokens=max_new_tokens, temperature=temperature, top_p=top_p, top_k=top_k,
164
  num_completions=num_completions, seed=seed, stop=literal_eval("'''"+stop+"'''"),
165
  )
166
- print(report_text)
167
  generated_area.markdown("<b>" + to_md(prompt) + "</b><mark style='background-color: #cbeacd'>" + to_md(report_text)+"</mark>", unsafe_allow_html=True)
168
 
169
  if __name__ == '__main__':
 
6
 
7
  def to_md(text):
8
  # return text.replace("\n", "<br />")
9
+ return text.replace("\n", "<br />")
10
 
11
  @st.cache
12
  def infer(
 
18
  top_k=40,
19
  num_completions=1,
20
  seed=42,
21
+ stop="\n"
22
  ):
23
  model_name_map = {
24
  "GPT-JT-6B-v1": "Together-gpt-JT-6B-v1",
 
130
  top_p = st.text_input('top_p', st.session_state.top_p)
131
  # num_completions = st.text_input('num_completions (only the best one will be returend)', "1")
132
  num_completions = "1"
133
+ stop = st.text_input('stop, split by;', r'\n')
134
  # seed = st.text_input('seed', "42")
135
  seed = "42"
136
 
 
163
  prompt, model_name=model_name, max_new_tokens=max_new_tokens, temperature=temperature, top_p=top_p, top_k=top_k,
164
  num_completions=num_completions, seed=seed, stop=literal_eval("'''"+stop+"'''"),
165
  )
 
166
  generated_area.markdown("<b>" + to_md(prompt) + "</b><mark style='background-color: #cbeacd'>" + to_md(report_text)+"</mark>", unsafe_allow_html=True)
167
 
168
  if __name__ == '__main__':