cvg077 commited on
Commit
c3a8c04
·
verified ·
1 Parent(s): 2b81559

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -50,9 +50,7 @@ def respond(
50
  ):
51
  token = message.choices[0].delta.content
52
  response += token
53
-
54
- # Append the response to the history
55
- history.append((message, response))
56
 
57
  # Prepare the next question if there are more questions left
58
  if question_index < len(interview_questions):
@@ -61,9 +59,9 @@ def respond(
61
  else:
62
  next_question = "Thank you for answering all the questions. Do you have any questions for me?"
63
 
64
- # Yield the assistant's response followed by the next question
65
- full_response = response + "\n\n" + next_question
66
- yield full_response
67
 
68
  """
69
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
@@ -73,7 +71,7 @@ demo = gr.ChatInterface(
73
  additional_inputs=[
74
  gr.Textbox(value="You are a manager conducting a job interview. Ask questions related to the candidate's experience, skills, and suitability for the role.", label="System message"),
75
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
76
- gr.Slider(minimum=0.1, maximum 4.0, value=0.7, step=0.1, label="Temperature"),
77
  gr.Slider(
78
  minimum=0.1,
79
  maximum=1.0,
 
50
  ):
51
  token = message.choices[0].delta.content
52
  response += token
53
+ yield response
 
 
54
 
55
  # Prepare the next question if there are more questions left
56
  if question_index < len(interview_questions):
 
59
  else:
60
  next_question = "Thank you for answering all the questions. Do you have any questions for me?"
61
 
62
+ # Append the response to the history and add the next question
63
+ history.append((message, response))
64
+ yield response + "\n\n" + next_question
65
 
66
  """
67
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
 
71
  additional_inputs=[
72
  gr.Textbox(value="You are a manager conducting a job interview. Ask questions related to the candidate's experience, skills, and suitability for the role.", label="System message"),
73
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
74
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
75
  gr.Slider(
76
  minimum=0.1,
77
  maximum=1.0,