markredito commited on
Commit
7c6a3f9
·
verified ·
1 Parent(s): 143fb9d

fixed `examples` paramater in gr.ChatInterface()

Browse files

The examples parameter in gr.ChatInterface() has been modified. Each example is now a list containing the message and the default values for the additional inputs (max_tokens, temperature, and top_p).

The structure of each example is now [message, max_tokens, temperature, top_p]. This matches the input structure expected by the chat_response function.

The default values for max_tokens (512), temperature (0.7), and top_p (0.95) are included with each example. You can adjust these values if you want different defaults for different examples.

The rest of the code remains the same as in the previous version.

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -139,9 +139,9 @@ with gr.Blocks() as demo:
139
  title="RAG Chatbot",
140
  description="Ask me anything about the documents in my knowledge base!",
141
  examples=[
142
- "How to do great work by Paul Graham?",
143
- "What are the key points in the article about doing great work?",
144
- "Can you summarize Paul Graham's advice on career success?"
145
  ],
146
  retry_btn="Retry",
147
  undo_btn="Undo",
 
139
  title="RAG Chatbot",
140
  description="Ask me anything about the documents in my knowledge base!",
141
  examples=[
142
+ ["How to do great work by Paul Graham?", 512, 0.7, 0.95],
143
+ ["What are the key points in the article about doing great work?", 512, 0.7, 0.95],
144
+ ["Can you summarize Paul Graham's advice on career success?", 512, 0.7, 0.95]
145
  ],
146
  retry_btn="Retry",
147
  undo_btn="Undo",