Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,12 +99,6 @@ convo = model.start_chat(history=[
|
|
| 99 |
},
|
| 100 |
])
|
| 101 |
|
| 102 |
-
|
| 103 |
-
def gemini_chat(message, history):
|
| 104 |
-
response = convo.send_message(message)
|
| 105 |
-
return response.text
|
| 106 |
-
|
| 107 |
-
run_button_component = gr.Button(value="Run", variant="primary", scale=1)
|
| 108 |
temperature_component = gr.Slider(
|
| 109 |
minimum=0,
|
| 110 |
maximum=1.0,
|
|
@@ -171,6 +165,12 @@ additional_inputs = [
|
|
| 171 |
top_p_component,
|
| 172 |
]
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
examples=[["I'm planning a vacation to India. Can you suggest a one-week itinerary including must-visit places and local cuisines to try?", None, None, None, None, None, ],
|
| 175 |
["Can you write a short story about a time-traveling detective who solves historical mysteries?", None, None, None, None, None,],
|
| 176 |
["I'm trying to learn French. Can you provide some common phrases that would be useful for a beginner, along with their pronunciations?", None, None, None, None, None,],
|
|
@@ -179,21 +179,22 @@ examples=[["I'm planning a vacation to India. Can you suggest a one-week itinera
|
|
| 179 |
["What are some unique features of Python that make it stand out compared to other systems programming languages like C++,Java?", None, None, None, None, None,],
|
| 180 |
]
|
| 181 |
|
| 182 |
-
gr.
|
| 183 |
-
|
| 184 |
-
gr.ChatInterface(
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
)
|
|
|
|
|
|
| 99 |
},
|
| 100 |
])
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
temperature_component = gr.Slider(
|
| 103 |
minimum=0,
|
| 104 |
maximum=1.0,
|
|
|
|
| 165 |
top_p_component,
|
| 166 |
]
|
| 167 |
|
| 168 |
+
def gemini_chat(message, history):
|
| 169 |
+
response = convo.send_message(message)
|
| 170 |
+
return response.text
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
|
| 174 |
examples=[["I'm planning a vacation to India. Can you suggest a one-week itinerary including must-visit places and local cuisines to try?", None, None, None, None, None, ],
|
| 175 |
["Can you write a short story about a time-traveling detective who solves historical mysteries?", None, None, None, None, None,],
|
| 176 |
["I'm trying to learn French. Can you provide some common phrases that would be useful for a beginner, along with their pronunciations?", None, None, None, None, None,],
|
|
|
|
| 179 |
["What are some unique features of Python that make it stand out compared to other systems programming languages like C++,Java?", None, None, None, None, None,],
|
| 180 |
]
|
| 181 |
|
| 182 |
+
with gr.Blocks(css=css) as chat:
|
| 183 |
+
gr.HTML(TITLE)
|
| 184 |
+
gr.ChatInterface(
|
| 185 |
+
fn=gemini_chat,
|
| 186 |
+
chatbot=gr.Chatbot(show_label=False,
|
| 187 |
+
avatar_images=(None, 'llava-logo.svg'),
|
| 188 |
+
show_share_button=False,
|
| 189 |
+
show_copy_button=True,
|
| 190 |
+
likeable=True,
|
| 191 |
+
layout="panel",
|
| 192 |
+
bubble_full_width=True
|
| 193 |
+
),
|
| 194 |
+
title="LLAVA: Large Language Virtual Assistant",
|
| 195 |
+
description="Official Demo Of ```LLAVA``` based on ```Large Language Virtual Assistant ```.",
|
| 196 |
+
additional_inputs=additional_inputs,
|
| 197 |
+
examples=examples,
|
| 198 |
+
concurrency_limit=20,
|
| 199 |
+
)
|
| 200 |
+
chat.launch(show_api=True)
|