Spaces:
Runtime error
Runtime error
Commit ·
ec6901a
1
Parent(s): 6668c8f
cp
Browse filesFiles changed (2)
- app.py+14-5
- requirements.txt+3
12345678import streamlit as st# Title of the applicationst.title('Hello, World!')# A button that when clicked will show a messageif st.button('Say hello'):st.write('Hello from Streamlit!')1234567891011121314151617import streamlit as stfrom transformers import pipeline# Load your model; this example uses the GPT-2 model for text generation.generator = pipeline('text-generation', model='gpt2')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 textresult = generator(user_input, max_length=50, num_return_sequences=1)# Display the generated textst.text_area("Generated Text", result[0]['generated_text'], height=150)
1streamlit1234streamlittransformerstorch
app.py+14-5
requirements.txt+3