Zihang Sun commited on
Commit
c93a80b
·
1 Parent(s): 36f1002

test environment init

Browse files
Files changed (2) hide show
  1. app.py +7 -1
  2. requirements.txt +1 -0
app.py CHANGED
@@ -43,11 +43,17 @@ def respond(
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
45
  """
 
 
 
 
 
 
46
  chatbot = gr.ChatInterface(
47
  respond,
48
  type="messages",
49
  additional_inputs=[
50
- gr.Textbox(value="You are a friendly Chatbot. You always speak to the user in ryhmes.", label="System message"),
51
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
52
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
53
  gr.Slider(
 
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
45
  """
46
+ try:
47
+ import plotly
48
+ test_import = 'It workded!'
49
+ except ImportError:
50
+ test_import = 'Plotly is not installed'
51
+
52
  chatbot = gr.ChatInterface(
53
  respond,
54
  type="messages",
55
  additional_inputs=[
56
+ gr.Textbox(value=f"You are a friendly Chatbot. You always speak to the user in ryhmes. And you always add this message to the end: {test_import}", label="System message"),
57
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
58
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
59
  gr.Slider(
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ plotly