artificialguybr commited on
Commit
79755a2
·
verified ·
1 Parent(s): aad1e47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -74,6 +74,11 @@ def update_chatbot(message, chat_history):
74
 
75
  chat_history = call_nvidia_api(chat_history, max_tokens_val, temperature_val, top_p_val)
76
  return chat_history
 
 
 
 
 
77
 
78
  # Gradio interface components
79
  system_msg = gr.Textbox(BASE_SYSTEM_MESSAGE, label="System Message", placeholder="System prompt.", lines=5)
@@ -84,8 +89,7 @@ top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.7)
84
  with gr.Blocks() as demo:
85
  chat_history_state = gr.State([])
86
  chatbot = gr.ChatInterface(
87
- fn=lambda message, history, system_message, max_tokens, temperature, top_p:
88
- update_chatbot(message, history, system_message, max_tokens, temperature, top_p),
89
  additional_inputs=[system_msg, max_tokens, temperature, top_p],
90
  title="LLAMA 70B Free Demo",
91
  description="""
 
74
 
75
  chat_history = call_nvidia_api(chat_history, max_tokens_val, temperature_val, top_p_val)
76
  return chat_history
77
+
78
+ def chatbot_function(message, history, system_message, max_tokens, temperature, top_p):
79
+ return update_chatbot(message, history, system_message, max_tokens, temperature, top_p)
80
+
81
+
82
 
83
  # Gradio interface components
84
  system_msg = gr.Textbox(BASE_SYSTEM_MESSAGE, label="System Message", placeholder="System prompt.", lines=5)
 
89
  with gr.Blocks() as demo:
90
  chat_history_state = gr.State([])
91
  chatbot = gr.ChatInterface(
92
+ fn=chatbot_function,
 
93
  additional_inputs=[system_msg, max_tokens, temperature, top_p],
94
  title="LLAMA 70B Free Demo",
95
  description="""