Yaro99 commited on
Commit
f190cda
verified
1 Parent(s): 633469c

Streamlit writer

Browse files
Files changed (1) hide show
  1. app.py +11 -3
app.py CHANGED
@@ -1,7 +1,15 @@
 
1
  from transformers import pipeline
2
- generator = pipeline("text-generation", model="EleutherAI/gpt-neo-2.7B")
3
 
 
 
 
 
4
  prompt = "hola"
5
- result = generator( prompt, max_length=400, num_return_sequences=1, do_sample=True, temperature=0.7, top_p=0.9, repetition_penalty=1.1, )
6
 
7
- print(result[0]['generated_text'])
 
 
 
 
 
 
1
+ import streamlit as st
2
  from transformers import pipeline
 
3
 
4
+ # Configuraci贸n del generador
5
+ generator = pipeline("text-generation", model="EleutherAI/gpt-neo-2.7B")
6
+
7
+ # Definir el prompt
8
  prompt = "hola"
 
9
 
10
+ # Generar el texto
11
+ result = generator(prompt, max_length=400, num_return_sequences=1, do_sample=True, temperature=0.7, top_p=0.9, repetition_penalty=1.1)
12
+
13
+ # Mostrar el resultado en la aplicaci贸n Streamlit
14
+ st.write("Texto generado:")
15
+ st.write(result[0]['generated_text'])