Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ def run_program(place, duration, start, end):
|
|
63 |
prompt = f"""Please generate a list of key cities and attractions in each cities for the following place: {place} suitable for {duration}, starting from {start} and ending at {end}, as a json list of less than 10 dictionaries with the following keys: 'city', 'attraction' and 'description'.
|
64 |
ALWAYS write the city and country in the 'city'. For instance do not only "city": "Paris" as the city but "city": "Paris, France". Don't combine multiplpe locations in one element. In the 'description', write the main attractions in that city as well.
|
65 |
Try to minimize the distance between locations. Always think of the transportation means that you want to use, and the timing: morning, afternoon, where to sleep.
|
66 |
-
|
67 |
|
68 |
response = llm_client.text_generation(prompt, max_new_tokens=3000) #, max_new_tokens=2000, stream=True)
|
69 |
itinerary, places_list = parse_output(response)
|
@@ -73,13 +73,9 @@ Only generate two sections: 'Itinerary:' provides a descriptive day-wise explana
|
|
73 |
return itinerary, mymap
|
74 |
|
75 |
|
76 |
-
with gr.Blocks(
|
77 |
-
|
78 |
-
|
79 |
-
secondary_hue=gr.themes.colors.blue,
|
80 |
-
)
|
81 |
-
) as demo:
|
82 |
-
gr.Markdown("# 🗺️ AI Travel Planner 🏕️\nThis personal travel planner is based on Mistral-7B-Instruct-v0.2, called through the Hugging Face API. Describe your destination, duration, starting and ending points of your trip. The AI assistant will suggest you an itinerary for the trip! \n Beware that the model does not have access to train or plane schedules, it is relying on general world knowledge!")
|
83 |
|
84 |
dest = gr.Textbox(
|
85 |
label="Destination",
|
|
|
63 |
prompt = f"""Please generate a list of key cities and attractions in each cities for the following place: {place} suitable for {duration}, starting from {start} and ending at {end}, as a json list of less than 10 dictionaries with the following keys: 'city', 'attraction' and 'description'.
|
64 |
ALWAYS write the city and country in the 'city'. For instance do not only "city": "Paris" as the city but "city": "Paris, France". Don't combine multiplpe locations in one element. In the 'description', write the main attractions in that city as well.
|
65 |
Try to minimize the distance between locations. Always think of the transportation means that you want to use, and the timing: morning, afternoon, where to sleep.
|
66 |
+
Strictly generate two sections: 'Itinerary:' provides a descriptive day-wise explanation of the itinerary formatted with bullet points, then you list the locations in 'Key points:'"""
|
67 |
|
68 |
response = llm_client.text_generation(prompt, max_new_tokens=3000) #, max_new_tokens=2000, stream=True)
|
69 |
itinerary, places_list = parse_output(response)
|
|
|
73 |
return itinerary, mymap
|
74 |
|
75 |
|
76 |
+
with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.green,secondary_hue=gr.themes.colors.blue)) as demo:
|
77 |
+
|
78 |
+
gr.Markdown("# ✈️ Smart Travel Planner 🗺️\nThis personal travel planner is based on Mistral-7B-Instruct-v0.2, called through the Hugging Face API. Describe your destination, duration, starting and ending points of your trip. The AI assistant will suggest you an itinerary for the trip! \n Beware that the model does not have access to train or plane schedules, it is relying on general world knowledge!")
|
|
|
|
|
|
|
|
|
79 |
|
80 |
dest = gr.Textbox(
|
81 |
label="Destination",
|