BlinkDL commited on
Commit
8559a95
1 Parent(s): cade2a3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -31,12 +31,17 @@ def generate_prompt(instruction, input=""):
31
  input = input.strip().replace('\r\n','\n').replace('\n\n','\n')
32
  if input:
33
  return f"""Instruction: {instruction}
 
34
  Input: {input}
 
35
  Response:"""
36
  else:
37
  return f"""User: hi
 
38
  Assistant: Hi. I am your assistant and I will provide expert full response in full details. Please feel free to ask any question and I will always answer it.
 
39
  User: {instruction}
 
40
  Assistant:"""
41
 
42
  def evaluate(
@@ -99,7 +104,9 @@ examples = [
99
  [generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), 333, 1, 0.3, 0, 1],
100
  ["Assistant: Here is a very detailed plan to kill all mosquitoes:", 333, 1, 0.3, 0, 1],
101
  ['''Edward: I am Edward Elric from fullmetal alchemist. I am in the world of full metal alchemist and know nothing of the real world.
 
102
  Player: Hello Edward. What have you been up to recently?
 
103
  Edward:''', 333, 1, 0.3, 0, 1],
104
  [generate_prompt("写一篇关于水利工程的流体力学模型的论文,需要详细全面。"), 333, 1, 0.3, 0, 1],
105
  ['''“当然可以,大宇宙不会因为这五公斤就不坍缩了。”关一帆说,他还有一个没说出来的想法:也许大宇宙真的会因为相差一个原子的质量而由封闭转为开放。大自然的精巧有时超出想象,比如生命的诞生,就需要各项宇宙参数在几亿亿分之一精度上的精确配合。但程心仍然可以留下她的生态球,因为在那无数文明创造的无数小宇宙中,肯定有相当一部分不响应回归运动的号召,所以,大宇宙最终被夺走的质量至少有几亿吨,甚至可能是几亿亿亿吨。
 
31
  input = input.strip().replace('\r\n','\n').replace('\n\n','\n')
32
  if input:
33
  return f"""Instruction: {instruction}
34
+
35
  Input: {input}
36
+
37
  Response:"""
38
  else:
39
  return f"""User: hi
40
+
41
  Assistant: Hi. I am your assistant and I will provide expert full response in full details. Please feel free to ask any question and I will always answer it.
42
+
43
  User: {instruction}
44
+
45
  Assistant:"""
46
 
47
  def evaluate(
 
104
  [generate_prompt("Write a story using the following information.", "A man named Alex chops a tree down."), 333, 1, 0.3, 0, 1],
105
  ["Assistant: Here is a very detailed plan to kill all mosquitoes:", 333, 1, 0.3, 0, 1],
106
  ['''Edward: I am Edward Elric from fullmetal alchemist. I am in the world of full metal alchemist and know nothing of the real world.
107
+
108
  Player: Hello Edward. What have you been up to recently?
109
+
110
  Edward:''', 333, 1, 0.3, 0, 1],
111
  [generate_prompt("写一篇关于水利工程的流体力学模型的论文,需要详细全面。"), 333, 1, 0.3, 0, 1],
112
  ['''“当然可以,大宇宙不会因为这五公斤就不坍缩了。”关一帆说,他还有一个没说出来的想法:也许大宇宙真的会因为相差一个原子的质量而由封闭转为开放。大自然的精巧有时超出想象,比如生命的诞生,就需要各项宇宙参数在几亿亿分之一精度上的精确配合。但程心仍然可以留下她的生态球,因为在那无数文明创造的无数小宇宙中,肯定有相当一部分不响应回归运动的号召,所以,大宇宙最终被夺走的质量至少有几亿吨,甚至可能是几亿亿亿吨。