Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
# Создаем тему
|
| 4 |
custom_theme = gr.themes.Soft(
|
| 5 |
primary_hue="yellow",
|
| 6 |
secondary_hue="blue",
|
|
@@ -21,7 +21,7 @@ css = """
|
|
| 21 |
|
| 22 |
def predict(message, history):
|
| 23 |
# Системная инструкция
|
| 24 |
-
system_prompt = "Тебя зовут
|
| 25 |
|
| 26 |
# Загружаем модель
|
| 27 |
client = gr.load("models/moonshotai/Kimi-K2-Thinking", provider="novita")
|
|
@@ -29,19 +29,14 @@ def predict(message, history):
|
|
| 29 |
full_query = f"{system_prompt}\n\nПользователь: {message}"
|
| 30 |
return client(full_query)
|
| 31 |
|
| 32 |
-
#
|
| 33 |
-
with gr.Blocks() as demo:
|
| 34 |
with gr.Sidebar(elem_id="side-bar"):
|
| 35 |
gr.Markdown("# **FlareAI**")
|
| 36 |
gr.Markdown("Flare — твой персональный ассистент")
|
| 37 |
button = gr.LoginButton("Войти")
|
| 38 |
|
| 39 |
-
# Убираем аргумент type, чтобы избежать TypeError
|
| 40 |
gr.ChatInterface(fn=predict)
|
| 41 |
|
| 42 |
-
#
|
| 43 |
-
demo.launch(
|
| 44 |
-
theme=custom_theme,
|
| 45 |
-
css=css,
|
| 46 |
-
fill_height=True
|
| 47 |
-
)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# Создаем тему заранее
|
| 4 |
custom_theme = gr.themes.Soft(
|
| 5 |
primary_hue="yellow",
|
| 6 |
secondary_hue="blue",
|
|
|
|
| 21 |
|
| 22 |
def predict(message, history):
|
| 23 |
# Системная инструкция
|
| 24 |
+
system_prompt = "Тебя зовут Gemini."
|
| 25 |
|
| 26 |
# Загружаем модель
|
| 27 |
client = gr.load("models/moonshotai/Kimi-K2-Thinking", provider="novita")
|
|
|
|
| 29 |
full_query = f"{system_prompt}\n\nПользователь: {message}"
|
| 30 |
return client(full_query)
|
| 31 |
|
| 32 |
+
# В Gradio 6.0 fill_height лучше указывать в самом Blocks, если launch его не принимает
|
| 33 |
+
with gr.Blocks(theme=custom_theme, css=css, fill_height=True) as demo:
|
| 34 |
with gr.Sidebar(elem_id="side-bar"):
|
| 35 |
gr.Markdown("# **FlareAI**")
|
| 36 |
gr.Markdown("Flare — твой персональный ассистент")
|
| 37 |
button = gr.LoginButton("Войти")
|
| 38 |
|
|
|
|
| 39 |
gr.ChatInterface(fn=predict)
|
| 40 |
|
| 41 |
+
# Оставляем запуск максимально простым
|
| 42 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|