Spaces:
Runtime error
Runtime error
fix
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from peft import AutoPeftModelForCausalLM
|
2 |
from transformers import AutoTokenizer
|
|
|
3 |
"""
|
4 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
5 |
"""
|
@@ -72,22 +73,22 @@ def respond(
|
|
72 |
"""
|
73 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
74 |
"""
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
|
91 |
|
92 |
-
|
93 |
-
|
|
|
1 |
from peft import AutoPeftModelForCausalLM
|
2 |
from transformers import AutoTokenizer
|
3 |
+
import gradio as gr
|
4 |
"""
|
5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
6 |
"""
|
|
|
73 |
"""
|
74 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
75 |
"""
|
76 |
+
demo = gr.ChatInterface(
|
77 |
+
respond,
|
78 |
+
additional_inputs=[
|
79 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
80 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
81 |
+
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
82 |
+
gr.Slider(
|
83 |
+
minimum=0.1,
|
84 |
+
maximum=1.0,
|
85 |
+
value=0.95,
|
86 |
+
step=0.05,
|
87 |
+
label="Top-p (nucleus sampling)",
|
88 |
+
),
|
89 |
+
],
|
90 |
+
)
|
91 |
|
92 |
|
93 |
+
if __name__ == "__main__":
|
94 |
+
demo.launch()
|