Spaces:
Runtime error
Runtime error
Commit ·
ec6901a
1
Parent(s): 6668c8f
cp
Browse filesFiles changed (2)
- app.py+14-5
- requirements.txt+3
123344566787891011121314151617import streamlit as stfrom transformers import pipeline
# Title of the applicationst.title('Hello, World!')# Load your model; this example uses the GPT-2 model for text generation.generator = pipeline('text-generation', model='gpt2')
# A button that when clicked will show a messageif st.button('Say hello'): st.write('Hello from Streamlit!')st.title('Hugging Face Model Integration')
# Text inputuser_input = st.text_input("Type a sentence to complete", "Streamlit is ")
# Generate text buttonif st.button('Generate'): # Generate text result = generator(user_input, max_length=50, num_return_sequences=1) # Display the generated text st.text_area("Generated Text", result[0]['generated_text'], height=150)1234streamlittransformerstorch
app.py+14-5
requirements.txt+3