Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,20 +77,19 @@ with gr.Blocks() as demo:
|
|
| 77 |
max_new = gr.Slider(64, 1024, value=512, step=16, label="max_new_tokens")
|
| 78 |
min_new = gr.Slider(0, 512, value=160, step=8, label="min_new_tokens")
|
| 79 |
|
| 80 |
-
# IMPORTANT: keep fn=chat_fn directly, and pass components via additional_inputs
|
| 81 |
gr.ChatInterface(
|
| 82 |
-
fn=chat_fn,
|
| 83 |
additional_inputs=[system_box, temperature, top_p, max_new, min_new],
|
| 84 |
-
chatbot=gr.Chatbot(height=520),
|
| 85 |
examples=[
|
| 86 |
-
"How do I practice Nishkama Karma at work?",
|
| 87 |
-
"What does 3.19 teach about duty without attachment?",
|
| 88 |
-
"How to overcome fear of failure according to the Gita?"
|
| 89 |
],
|
| 90 |
)
|
| 91 |
|
| 92 |
-
|
| 93 |
-
demo.queue(concurrency_count=2) # keep for ZeroGPU; harmless on normal GPU
|
| 94 |
if __name__ == "__main__":
|
| 95 |
demo.launch()
|
| 96 |
|
|
|
|
|
|
| 77 |
max_new = gr.Slider(64, 1024, value=512, step=16, label="max_new_tokens")
|
| 78 |
min_new = gr.Slider(0, 512, value=160, step=8, label="min_new_tokens")
|
| 79 |
|
|
|
|
| 80 |
gr.ChatInterface(
|
| 81 |
+
fn=chat_fn, # def chat_fn(message, history, system_text, temperature, top_p, max_new, min_new)
|
| 82 |
additional_inputs=[system_box, temperature, top_p, max_new, min_new],
|
| 83 |
+
chatbot=gr.Chatbot(height=520, type="tuples"), # keep tuple history; no behavior change
|
| 84 |
examples=[
|
| 85 |
+
["How do I practice Nishkama Karma at work?", system_box.value, 0.7, 0.9, 512, 160],
|
| 86 |
+
["What does 3.19 teach about duty without attachment?", system_box.value, 0.7, 0.9, 512, 160],
|
| 87 |
+
["How to overcome fear of failure according to the Gita?", system_box.value, 0.7, 0.9, 512, 160],
|
| 88 |
],
|
| 89 |
)
|
| 90 |
|
| 91 |
+
demo.queue(concurrency_count=2) # keep for ZeroGPU
|
|
|
|
| 92 |
if __name__ == "__main__":
|
| 93 |
demo.launch()
|
| 94 |
|
| 95 |
+
|