File size: 1,114 Bytes
6385041
 
6e85008
 
6385041
 
 
6e85008
b44c3dc
6385041
 
b44c3dc
6385041
b44c3dc
 
 
 
6e85008
 
b44c3dc
 
 
 
 
6385041
b44c3dc
 
 
6385041
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)