HaveAI commited on
Commit
08f59c3
·
verified ·
1 Parent(s): 2ebd436

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -1,19 +1,7 @@
1
  import gradio as gr
2
- from transformers import pipeline
3
 
4
- # Заменить модель на свою
5
- pipe = pipeline("text-generation", model="openai-community/gpt2")
6
 
7
- def chat_fn(message, history):
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