zmbfeng commited on
Commit
f6f9adc
·
verified ·
1 Parent(s): e551817

examples moved to string

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -35,8 +35,8 @@ def create_response(input_str,
35
  num_return_sequences=int(num_return_sequences)
36
  print("num_return_sequences" + str(num_return_sequences))
37
  print("top_p" + str(top_p))
38
- # top_k=int(top_k)
39
- # print("top_k" + str(top_k))
40
  print("repetition_penalty" + str(repetition_penalty))
41
  print("temperature" + str(temperature))
42
  print("do_sample" + str(do_sample))
@@ -65,7 +65,7 @@ def create_response(input_str,
65
  return outputs
66
 
67
 
68
-
69
  common_examples=[
70
  ["What is death?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The first example
71
  ["One of the best teachers in all of life turns out to be what?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The second example
@@ -79,8 +79,8 @@ for example in examples:
79
  print(examples)
80
  interface_original = gr.Interface(fn=create_response,
81
  title="original",
82
- description="original language model, no fine tuning",
83
- examples=examples,
84
  inputs=[
85
  gr.Textbox(label="input text here", lines=3),
86
  # gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
@@ -123,8 +123,8 @@ print(examples)
123
 
124
  interface_untethered_model = gr.Interface(fn=create_response,
125
  title="untethered model",
126
- description="language model fine tuned with'The Untethered Soul' chapter 17",
127
- examples=examples,
128
  inputs=[
129
  gr.Textbox(label="input text here", lines=3),
130
  # gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
@@ -166,8 +166,8 @@ for example in examples:
166
  print(examples)
167
  interface_untethered_paraphrased_model = gr.Interface(fn=create_response,
168
  title="untethered paraphrased_model",
169
- description="language model fine tuned with'The Untethered Soul' chapter 17 paraphrased",
170
- examples=examples,
171
  inputs=[
172
  gr.Textbox(label="input text here", lines=3),
173
  # gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
 
35
  num_return_sequences=int(num_return_sequences)
36
  print("num_return_sequences" + str(num_return_sequences))
37
  print("top_p" + str(top_p))
38
+ top_k=int(top_k)
39
+ print("top_k" + str(top_k))
40
  print("repetition_penalty" + str(repetition_penalty))
41
  print("temperature" + str(temperature))
42
  print("do_sample" + str(do_sample))
 
65
  return outputs
66
 
67
 
68
+ common_examples_string="\nSample Inputs:\nWhat is death?\nOne of the best teachers in all of life turns out to be what?\nwhat is your most meaningful relationship?\nWhat actually gives life meaning?\n"
69
  common_examples=[
70
  ["What is death?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The first example
71
  ["One of the best teachers in all of life turns out to be what?",default_num_return_sequences,default_temperature,default_repetition_penalty,default_top_p,default_top_k,default_do_sample], # The second example
 
79
  print(examples)
80
  interface_original = gr.Interface(fn=create_response,
81
  title="original",
82
+ description="original language model, no fine tuning"+common_examples_string,
83
+ #examples=examples,
84
  inputs=[
85
  gr.Textbox(label="input text here", lines=3),
86
  # gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
 
123
 
124
  interface_untethered_model = gr.Interface(fn=create_response,
125
  title="untethered model",
126
+ description="language model fine tuned with'The Untethered Soul' chapter 17"+common_examples_string,
127
+ #examples=examples,
128
  inputs=[
129
  gr.Textbox(label="input text here", lines=3),
130
  # gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +
 
166
  print(examples)
167
  interface_untethered_paraphrased_model = gr.Interface(fn=create_response,
168
  title="untethered paraphrased_model",
169
+ description="language model fine tuned with'The Untethered Soul' chapter 17 paraphrased"+common_examples_string,
170
+ #examples=examples,
171
  inputs=[
172
  gr.Textbox(label="input text here", lines=3),
173
  # gr.Number(label="num_beams (integer) explores the specified number of possible outputs and selects the most " +