Severian commited on
Commit
255e744
·
1 Parent(s): 98d5215

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -2
app.py CHANGED
@@ -71,8 +71,27 @@ additional_inputs=[
71
  )
72
  ]
73
 
74
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  chatbot.like(vote, None, None)
 
76
 
77
  if __name__ == "__main__":
78
- demo.queue().launch()
 
71
  )
72
  ]
73
 
74
+ character = "Sherlock Holmes"
75
+ series = "Arthur Conan Doyle's novel"
76
+
77
+ iface = gr.ChatInterface(
78
+ fn = generater,
79
+ title=title,
80
+ description = description,
81
+ chatbot=chatbot,
82
+ additional_inputs=additional_inputs,
83
+ examples=[
84
+ ["Hello there! How are you doing?"],
85
+ ["How many hours does it take a man to eat a Helicopter?"],
86
+ ["You are a helpful and honest assistant. Always answer as helpfully as possible. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."],
87
+ ["I want you to act as a spoken English teacher and improver. I will speak to you in English and you will reply to me in English to practice my spoken English. I want you to strictly correct my grammar mistakes, typos, and factual errors. I want you to ask me a question in your reply. Now let's start practicing, you could ask me a question first. Remember, I want you to strictly correct my grammar mistakes, typos, and factual errors."],
88
+ [f"I want you to act like {character} from {series}. I want you to respond and answer like {character} using the tone, manner and vocabulary {character} would use. Do not write any explanations. Only answer like {character}. You must know all of the knowledge of {character}."]
89
+ ]
90
+ )
91
+
92
+ with gr.Blocks(css="resourse/style/custom.css") as demo:
93
  chatbot.like(vote, None, None)
94
+ iface.render()
95
 
96
  if __name__ == "__main__":
97
+ demo.queue(max_size=3).launch()