rohan13 commited on
Commit
c10c45d
1 Parent(s): d72e512

disabled postprocess

Browse files
Files changed (2) hide show
  1. app.py +1 -2
  2. main.py +0 -1
app.py CHANGED
@@ -4,7 +4,6 @@ from main import chat, index_url
4
  """Use text to call chat method from main.py"""
5
  def add_text(history, text):
6
  response = chat(question=text)
7
- response = response.encode("utf-8", "ignore").decode("utf-8")
8
  print(response)
9
  history = history + [(text, response)]
10
  return history, ""
@@ -34,7 +33,7 @@ with gr.Blocks() as demo:
34
  placeholder="Enter url api endpoint",
35
  ).style(container=False)
36
 
37
- txt.submit(add_text, [chatbot, txt], [chatbot, txt]).then(
38
  bot, chatbot, chatbot
39
  )
40
  url.submit(add_url, [chatbot, url], [chatbot, url]).then(
 
4
  """Use text to call chat method from main.py"""
5
  def add_text(history, text):
6
  response = chat(question=text)
 
7
  print(response)
8
  history = history + [(text, response)]
9
  return history, ""
 
33
  placeholder="Enter url api endpoint",
34
  ).style(container=False)
35
 
36
+ txt.submit(add_text, [chatbot, txt], [chatbot, txt], postprocess=False).then(
37
  bot, chatbot, chatbot
38
  )
39
  url.submit(add_url, [chatbot, url], [chatbot, url]).then(
main.py CHANGED
@@ -36,7 +36,6 @@ def chat(question):
36
  global agent
37
  if agent is not None:
38
  response = agent.run(question)
39
- print(response)
40
  else:
41
  response = "Please add a request url first"
42
  return response
 
36
  global agent
37
  if agent is not None:
38
  response = agent.run(question)
 
39
  else:
40
  response = "Please add a request url first"
41
  return response