Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ def chat_with_gemma(user_input, temperature, top_p, frequency_penalty, presence_
|
|
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")
|
@@ -49,9 +49,5 @@ with gr.Blocks() as demo:
|
|
49 |
|
50 |
demo.launch(share=True)
|
51 |
|
52 |
-
|
53 |
-
# Launch the ap
|
54 |
-
demo.launch(share=True, enable_api=False)
|
55 |
-
|
56 |
#demo.launch(auth=("username", "password"))
|
57 |
-
#enable the above
|
|
|
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. If you want to use this space via api, duplicate it and look in the app.py file to see an easy (and secure) way to enable api :)")
|
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")
|
|
|
49 |
|
50 |
demo.launch(share=True)
|
51 |
|
|
|
|
|
|
|
|
|
52 |
#demo.launch(auth=("username", "password"))
|
53 |
+
#enable the above, remove the current demo.launch settings, and set api to true right above to enable api useage, but enable a password and username to prevent someone form using your api. Currently set to default username 'username' and default password 'password'.
|