Spaces:
Build error
Build error
| # app.py | |
| import streamlit as st | |
| from transformers import pipeline | |
| # Load the Hugging Face model (e.g., GPT-2) | |
| generator = pipeline("text-generation", model="gpt2") | |
| def generate_design_inspiration(keywords): | |
| prompt = f"Design a {', '.join(keywords)}-themed website." | |
| inspiration = generator(prompt, max_length=100, num_return_sequences=1)[0]["generated_text"] | |
| return inspiration | |
| def main(): | |
| st.title("Design Inspiration Generator") | |
| st.write("Enter keywords related to your project:") | |
| keywords = st.text_input("Keywords (comma-separated)", "minimalist, eco-friendly, modern") | |
| if st.button("Generate Inspiration"): | |
| inspiration = generate_design_inspiration(keywords.split(",")) | |
| st.markdown(f"**Design Inspiration:**\n\n{inspiration}") | |
| if __name__ == "__main__": | |
| main() | |