joeshore commited on
Commit
a8d4c5b
·
1 Parent(s): 301592a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -8,10 +8,10 @@ all_input = st.text_area('模型输入', value="""
8
  今天,我们正式发布名为 DeeplySorry 的大规模神经网络模型,它可以代替您向您珍惜的亲人、朋友、爱人道歉。\n""", height=100)
9
 
10
 
11
- with st.expander("配置"):
12
- top_p = st.slider('top p', 0.0, 1.0, 0.95)
13
- temperature = st.slider('temperature', 0.0, 1.0, 0.8)
14
- max_tokens = st.slider('max tokens', 4, 512, 64)
15
 
16
 
17
  def completion(prompt):
@@ -31,6 +31,7 @@ def completion(prompt):
31
  st.error(f'Bad response: {resp}')
32
  else:
33
  answers = resp.json()
 
34
  answers = [c['text'] for c in answers['choices'] if c['text'] is not None]
35
  cols = st.columns(3)
36
  for idx, answer in enumerate(answers):
 
8
  今天,我们正式发布名为 DeeplySorry 的大规模神经网络模型,它可以代替您向您珍惜的亲人、朋友、爱人道歉。\n""", height=100)
9
 
10
 
11
+
12
+ top_p = st.slider('top_p', 0.0, 1.0, 0.95)
13
+ temperature = st.slider('temperature', 0.0, 1.0, 0.85)
14
+ max_tokens = st.slider('max tokens', 4, 512, 64)
15
 
16
 
17
  def completion(prompt):
 
31
  st.error(f'Bad response: {resp}')
32
  else:
33
  answers = resp.json()
34
+ st.json(answer)
35
  answers = [c['text'] for c in answers['choices'] if c['text'] is not None]
36
  cols = st.columns(3)
37
  for idx, answer in enumerate(answers):