Add title
Browse files
app.py
CHANGED
@@ -38,8 +38,10 @@ def respond(
|
|
38 |
|
39 |
outputs = pipeline(
|
40 |
messages,
|
41 |
-
max_new_tokens=
|
42 |
-
|
|
|
|
|
43 |
)
|
44 |
|
45 |
yield outputs[0]["generated_text"][-1]["content"]
|
@@ -47,21 +49,22 @@ def respond(
|
|
47 |
"""
|
48 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
49 |
"""
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
|
|
65 |
|
66 |
|
67 |
if __name__ == "__main__":
|
|
|
38 |
|
39 |
outputs = pipeline(
|
40 |
messages,
|
41 |
+
max_new_tokens=max_tokens,
|
42 |
+
temperature=temprature,
|
43 |
+
top_p=top_p,
|
44 |
+
eos_token_id=terminators
|
45 |
)
|
46 |
|
47 |
yield outputs[0]["generated_text"][-1]["content"]
|
|
|
49 |
"""
|
50 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
51 |
"""
|
52 |
+
with gr.Blocks() as demo:
|
53 |
+
gr.Markdown("# 🇮🇩 Sahabat AI (Gemma)")
|
54 |
+
gr.ChatInterface(
|
55 |
+
respond,
|
56 |
+
additional_inputs=[
|
57 |
+
gr.Slider(minimum=1, maximum=2048, value=256, 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(
|
60 |
+
minimum=0.1,
|
61 |
+
maximum=1.0,
|
62 |
+
value=0.95,
|
63 |
+
step=0.05,
|
64 |
+
label="Top-p (nucleus sampling)",
|
65 |
+
),
|
66 |
+
],
|
67 |
+
)
|
68 |
|
69 |
|
70 |
if __name__ == "__main__":
|