Update app.py
Browse files
app.py
CHANGED
|
@@ -90,7 +90,7 @@ demo = gr.ChatInterface(
|
|
| 90 |
fn=chat,
|
| 91 |
title="Puter LLMs via LiteLLM",
|
| 92 |
additional_inputs=[
|
| 93 |
-
gr.Dropdown(MODEL_CHOICES, value=("
|
| 94 |
gr.Textbox(label="System-Prompt", value="You are a helpful assistant.", lines=2),
|
| 95 |
gr.Slider(0, 2, value=0.3, step=0.1, label="Temperature"),
|
| 96 |
gr.Slider(64, 8192, value=8192, step=64, label="Max Tokens"),
|
|
@@ -105,14 +105,7 @@ demo = gr.ChatInterface(
|
|
| 105 |
)
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
| 108 |
-
user, pw = os.getenv("APP_USERNAME"), os.getenv("APP_PASSWORD")
|
| 109 |
-
if not (user and pw) and os.getenv("ALLOW_PUBLIC") != "1":
|
| 110 |
-
raise SystemExit(
|
| 111 |
-
"APP_USERNAME/APP_PASSWORD nicht gesetzt. Sonst kann jeder dein Puter-Kontingent "
|
| 112 |
-
"verbrauchen. (Bewusst öffentlich? -> ALLOW_PUBLIC=1)"
|
| 113 |
-
)
|
| 114 |
demo.queue().launch(
|
| 115 |
server_name="0.0.0.0",
|
| 116 |
server_port=int(os.getenv("PORT", "7860")),
|
| 117 |
-
auth=(user, pw) if user and pw else None,
|
| 118 |
)
|
|
|
|
| 90 |
fn=chat,
|
| 91 |
title="Puter LLMs via LiteLLM",
|
| 92 |
additional_inputs=[
|
| 93 |
+
gr.Dropdown(MODEL_CHOICES, value=("gemini-2.5-flash-lite" if "gemini-2.5-flash-lite" in MODEL_CHOICES else MODEL_CHOICES[0]), label="Modell", allow_custom_value=True),
|
| 94 |
gr.Textbox(label="System-Prompt", value="You are a helpful assistant.", lines=2),
|
| 95 |
gr.Slider(0, 2, value=0.3, step=0.1, label="Temperature"),
|
| 96 |
gr.Slider(64, 8192, value=8192, step=64, label="Max Tokens"),
|
|
|
|
| 105 |
)
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
demo.queue().launch(
|
| 109 |
server_name="0.0.0.0",
|
| 110 |
server_port=int(os.getenv("PORT", "7860")),
|
|
|
|
| 111 |
)
|