Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,20 +30,25 @@ def chat_with_gemma(user_input, temperature, top_p, frequency_penalty, presence_
|
|
30 |
|
31 |
return response["choices"][0]["message"]["content"].strip()
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
# Launch the ap
|
49 |
demo.launch(share=True, enable_api=False)
|
|
|
30 |
|
31 |
return response["choices"][0]["message"]["content"].strip()
|
32 |
|
33 |
+
with gr.Blocks() as demo:
|
34 |
+
user_input = gr.Textbox(label="Enter your message to Gemma")
|
35 |
+
temperature = gr.Slider(0.0, 1.5, value=0.7, step=0.05, label="Temperature")
|
36 |
+
top_p = gr.Slider(0.0, 1.0, value=0.9, step=0.05, label="Top-p (Nucleus Sampling)")
|
37 |
+
freq_penalty = gr.Slider(0.0, 2.0, value=0.4, step=0.1, label="Frequency Penalty")
|
38 |
+
pres_penalty = gr.Slider(0.0, 2.0, value=0.2, step=0.1, label="Presence Penalty")
|
39 |
+
output = gr.Textbox(label="Gemma's Response", lines=8)
|
40 |
+
|
41 |
+
submit_button = gr.Button("Submit")
|
42 |
+
|
43 |
+
submit_button.click(
|
44 |
+
chat_with_gemma,
|
45 |
+
inputs=[user_input, temperature, top_p, freq_penalty, pres_penalty],
|
46 |
+
outputs=output,
|
47 |
+
api_name=False # <---- This disables API for this endpoint
|
48 |
+
)
|
49 |
+
|
50 |
+
demo.launch(share=True)
|
51 |
+
|
52 |
|
53 |
# Launch the ap
|
54 |
demo.launch(share=True, enable_api=False)
|