Spaces:
Runtime error
Runtime error
Emilianohack
commited on
Commit
·
48e7e94
1
Parent(s):
7611083
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline, set_send
|
2 |
+
generator = pipeline('text-generation', model='bigscience/bloom')
|
3 |
+
generator("Conversacion entre Sara y Emiliano", max_length=30, num_return_sequences=5)
|
4 |
+
|
5 |
+
context = '''Hola
|
6 |
+
Hola
|
7 |
+
Como estas
|
8 |
+
Bien y tu
|
9 |
+
Igual bien
|
10 |
+
Que haces
|
11 |
+
Nada y tu'''
|
12 |
+
|
13 |
+
while True:
|
14 |
+
output = generator(context, max_length=len(context) + 30, num_return_sequences=1)[0]['generated_text'].split(context)[1].split(\nSara:)[0]
|
15 |
+
print(output)
|
16 |
+
context += output + '\nSara:'
|
17 |
+
inputText = input('Yo:')
|
18 |
+
context += inputText + '\nSara:'
|