Spaces:
				
			
			
	
			
			
		Build error
		
	
	
	
			
			
	
	
	
	
		
		
		Build error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -2,8 +2,8 @@ import streamlit as st | |
| 2 | 
             
            from transformers import AutoTokenizer, AutoModelForCausalLM
         | 
| 3 |  | 
| 4 | 
             
            # Load the model and tokenizer
         | 
| 5 | 
            -
            tokenizer = AutoTokenizer.from_pretrained(" | 
| 6 | 
            -
            model = AutoModelForCausalLM.from_pretrained(" | 
| 7 |  | 
| 8 | 
             
            # Streamlit UI styling
         | 
| 9 | 
             
            st.set_page_config(page_title="Email Generator", layout="centered")
         | 
| @@ -35,13 +35,7 @@ st.markdown(""" | |
| 35 | 
             
                    .button:hover {
         | 
| 36 | 
             
                        background-color: #4B0082;
         | 
| 37 | 
             
                    }
         | 
| 38 | 
            -
             | 
| 39 | 
            -
                        background-color: #f4f4f4;
         | 
| 40 | 
            -
                        padding: 15px;
         | 
| 41 | 
            -
                        border-radius: 10px;
         | 
| 42 | 
            -
                        border: 1px solid #ddd;
         | 
| 43 | 
            -
                        font-family: 'Courier New', Courier, monospace;
         | 
| 44 | 
            -
                    }
         | 
| 45 | 
             
                </style>
         | 
| 46 | 
             
            """, unsafe_allow_html=True)
         | 
| 47 |  | 
| @@ -68,6 +62,6 @@ if generate_button: | |
| 68 |  | 
| 69 | 
             
                    # Display the generated email with some styling
         | 
| 70 | 
             
                    st.markdown('<div class="header">Generated Email:</div>', unsafe_allow_html=True)
         | 
| 71 | 
            -
                    st.markdown(f'<div | 
| 72 | 
             
                else:
         | 
| 73 | 
             
                    st.error("Please enter a prompt to generate the email.")
         | 
|  | |
| 2 | 
             
            from transformers import AutoTokenizer, AutoModelForCausalLM
         | 
| 3 |  | 
| 4 | 
             
            # Load the model and tokenizer
         | 
| 5 | 
            +
            tokenizer = AutoTokenizer.from_pretrained("postbot/gpt2-medium-emailgen")
         | 
| 6 | 
            +
            model = AutoModelForCausalLM.from_pretrained("postbot/gpt2-medium-emailgen")
         | 
| 7 |  | 
| 8 | 
             
            # Streamlit UI styling
         | 
| 9 | 
             
            st.set_page_config(page_title="Email Generator", layout="centered")
         | 
|  | |
| 35 | 
             
                    .button:hover {
         | 
| 36 | 
             
                        background-color: #4B0082;
         | 
| 37 | 
             
                    }
         | 
| 38 | 
            +
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 39 | 
             
                </style>
         | 
| 40 | 
             
            """, unsafe_allow_html=True)
         | 
| 41 |  | 
|  | |
| 62 |  | 
| 63 | 
             
                    # Display the generated email with some styling
         | 
| 64 | 
             
                    st.markdown('<div class="header">Generated Email:</div>', unsafe_allow_html=True)
         | 
| 65 | 
            +
                    st.markdown(f'<div>{generated_email}</div>', unsafe_allow_html=True)
         | 
| 66 | 
             
                else:
         | 
| 67 | 
             
                    st.error("Please enter a prompt to generate the email.")
         |