Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from transformers import pipeline | |
| import tensorflow | |
| ################################################### | |
| model_name = "declare-lab/flan-alpaca-gpt4-xl" | |
| pipe = pipeline("text-generation", model=model_name) | |
| st.title("Which Resort is best for you?") | |
| weathers = ["Sunny", "Rainy", "Snowy"] | |
| activities = ["Skiing", "Hiking", "Swimming", "Relaxing"] | |
| weather = st.selectbox("What is the weather like?", weathers) | |
| activity = st.selectbox("What activity do you prefer?", activities) | |
| input_prompt = f"I'm looking for a resort recommendation. The weather should be {weather.lower()}, and I'm interested in activities like {activity.lower()}. What do you suggest?" | |
| if st.button('Recommend a Resort'): | |
| with st.spinner('Generating recommendation...'): | |
| # Generate text based on the input prompt | |
| generated_texts = pipe(input_prompt, max_length=50, num_return_sequences=1) | |
| recommendation = generated_texts[0]['generated_text'] | |
| # Displaying the generated recommendation | |
| st.subheader("Recommended Resort:") | |
| st.write(recommendation) | |