Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
# Получаем ответ от модели
|
9 |
-
output = pipe(message, max_new_tokens=200)[0]['generated_text']
|
10 |
-
# Можно очистить префикс, если он дублирует prompt
|
11 |
-
return output.strip()
|
12 |
-
|
13 |
-
gr.ChatInterface(
|
14 |
-
fn=chat_fn,
|
15 |
-
title="Flare Chat",
|
16 |
-
theme="soft", # Можно убрать или изменить
|
17 |
-
examples=["Привет!", "Расскажи шутку", "Кто такой Эйнштейн?"],
|
18 |
-
).launch()
|
19 |
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
def respond(message, history):
|
4 |
+
return f"Ты сказал: {message}"
|
5 |
|
6 |
+
gr.ChatInterface(fn=respond, title="Flare Chat").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|