IgorAndreic commited on
Commit
aef176a
·
verified ·
1 Parent(s): 05a15a9

Delete App

Browse files
Files changed (1) hide show
  1. app +0 -20
app DELETED
@@ -1,20 +0,0 @@
1
- import gradio as gr
2
- from transformers import pipeline
3
-
4
- # Создаем конвейер генерации текста с помощью предварительно обученной модели
5
- generator = pipeline('text-generation', model='gpt2')
6
-
7
- def generate_text(prompt):
8
- # Генерируем текст на основе введенного пользователем запроса
9
- result = generator(prompt, max_length=50, num_return_sequences=1)
10
- return result[0]['generated_text']
11
-
12
- # Создаем интерфейс Gradio
13
- interface = gr.Interface(fn=generate_text,
14
- inputs=gr.inputs.Textbox(lines=2, placeholder="Введите текст..."),
15
- outputs='text',
16
- title="Генератор текста на основе GPT-2",
17
- description="Введите начало предложения и получите продолжение от GPT-2.")
18
-
19
- # Запускаем приложение
20
- interface.launch()