File size: 821 Bytes
e210428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "mergekit-community/qwen-2.5-o1.like-pluse"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

def generate_response(prompt):
    inputs = tokenizer(prompt, return_tensors="pt")
    outputs = model.generate(**inputs, max_length=150, temperature=0.7)
    response = tokenizer.decode(outputs[0], skip_special_tokens=True)
    return response

iface = gr.Interface(
    fn=generate_response,
    inputs=gr.inputs.Textbox(lines=2, placeholder="Введите ваш вопрос"),
    outputs="text",
    title="Qwen-2.5-O1.Like-Pluse",
    description="Интерфейс для взаимодействия с моделью Qwen-2.5-O1.Like-Pluse"
)

iface.launch()