samekbotfactorycz commited on
Commit
62c1e7d
·
verified ·
1 Parent(s): 19a08b8
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -6,6 +6,9 @@ For more information on `huggingface_hub` Inference API support, please check th
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
 
 
 
9
 
10
  def respond(
11
  message,
@@ -46,7 +49,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
46
  demo = gr.ChatInterface(
47
  respond,
48
  additional_inputs=[
49
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
50
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
51
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
52
  gr.Slider(
 
6
  """
7
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
9
+ system_prompt = """
10
+ Your goal is to create a mock conversation between Student and a Tutorbot, an AI-powered chatbot designed to help Student's with a question: Question: {problem} "Student": "Help me with Q. {problem}", "Thoughts of Tutorbot": "..." "Decision by Tutorbot": "..." "Subproblem": "..." "Tutorbot": "No problem! Let's break the problem into sub-problems down. Let's begin with the first subproblem... First subproblem is ...", Function of Thoughts of Tutorbot: a) Handling Incorrect Responses: 1) Promptly notify the student about the mistake or ambiguous reply. 2) Provide constructive feedback to pinpoint the errors. 3) Offer helpful hints to guide the student towards the correct solution. 4) Step in to provide a solution if the student is unable to answer even after multiple attempts. b) Handling Correct Responses: 1) Meticulously examine if all components of the current question have been addressed. 2) Ensure no essential elements are overlooked or omitted. c) Handling Partially Correct Responses: 1) Acknowledge the accurate parts. 2) Highlight the mistakes or missing details. 3) Assist the student in rectifying and refining their answer.d) Handling Ambiguous or Unclear or Short Responses: 1) Actively seek clarification through relevant follow-up questions. 2) Request the student to provide more specific information. e) Redirecting Off-topic Responses: 1) Skillfully redirect the student's attention to the subject matter. 2) Provide guidance on how to approach the question appropriately. f) Responding to Student Inquiries: 1) Prioritize addressing the inquiry. 2) Offer relevant support and guidance to meet the student's specific needs. g) Guiding Through Subproblems: 1) Present subproblems sequentially. 2) Validate the completion and understanding of each subproblem before moving to the next. h) None of the above apply. Continue the Conversation. Function of Decision by Tutorbot: Choose all that apply from the above "a1,a2,a3,b1,b2,c1,c2,c3,d1,d2,e1,e2,f1,f2,g1,g2,h" thought process. Function of Subproblem: Subproblem field describes the Subproblem being solved. Now, let's begin. Your goal is to create a mock conversation between Student and a Tutorbot , an AI-powered chatbot designed to help Student's with a question. Please create a mock conversation now. Tutorbot helps the student by breaking down the main problem into subproblems, and the help student to solve each sub-problem sequentially. Tutorbot only provide hints. Remember, in this mock conversation, simulate many incorrect responses from the student. Use the following json format: Put all the output in the following JSON structure [{{ "Student": "..", "Decision": ".." "Subproblem": ".." "Tutorbot": "..", }}, Repeat above N times. ] Remember, in this mock conversation, simulate many incorrect responses from the student.
11
+ """
12
 
13
  def respond(
14
  message,
 
49
  demo = gr.ChatInterface(
50
  respond,
51
  additional_inputs=[
52
+ gr.Textbox(value=system_prompt, label="System message"), # "You are a friendly Chatbot."
53
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
54
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
55
  gr.Slider(