Rooni commited on
Commit
367912e
·
verified ·
1 Parent(s): 9483f07

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import bardapi
2
+
3
+ # Загружаем модель
4
+ model = bardapi.BardModel("bard-base")
5
+
6
+ # Создаем функцию, которая генерирует текст
7
+ def generate_text(prompt):
8
+ return model.generate_text(prompt)
9
+
10
+ # Создаем интерфейс
11
+ gr.Interface(generate_text,
12
+ title="Генератор текста",
13
+ description="Генерирует текст по заданному запросу",
14
+ input_components=[gr.TextInput(label="Запрос")],
15
+ output_components=[gr.OutputText(label="Текст")])