File size: 444 Bytes
05d5f0d
fd5c58c
05d5f0d
fd5c58c
 
05d5f0d
fd5c58c
 
 
 
 
05d5f0d
fd5c58c
 
05d5f0d
fd5c58c
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline

# Загрузка модели
model = pipeline("conversational", model="LLM360/K2-Chat")

def chat(message, history):
    history.append((message, ""))
    response = model(history)
    history[-1] = (message, response[0]['generated_text'])
    return history, ""

# Создание интерфейса
iface = gr.ChatInterface(chat)

# Запуск интерфейса
iface.launch()