Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -171,27 +171,25 @@ def get_embed_url(raw_url: str) -> str:
|
|
| 171 |
|
| 172 |
# --- GRADIO INTERFACE ---
|
| 173 |
if __name__ == "__main__":
|
| 174 |
-
load_data_and_create_vectorstore()
|
| 175 |
-
if retriever is None or client is None:
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
else:
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
search_button.click(
|
| 190 |
fn=query_memes,
|
| 191 |
inputs=search_input,
|
| 192 |
outputs=[search_output_video, search_output_text]
|
| 193 |
)
|
| 194 |
-
|
| 195 |
examples=[["a man running"],["sharing"],["immigrant in france"]],
|
| 196 |
inputs=search_input,
|
| 197 |
outputs=[search_output_video, search_output_text],
|
|
|
|
| 171 |
|
| 172 |
# --- GRADIO INTERFACE ---
|
| 173 |
if __name__ == "__main__":
|
| 174 |
+
# load_data_and_create_vectorstore()
|
| 175 |
+
# if retriever is None or client is None:
|
| 176 |
+
# print("Gradio interface will not run due to RAG/LLM initialization errors.")
|
| 177 |
+
|
| 178 |
+
# else:
|
| 179 |
+
with gr.Blocks(title="Moul Lmemes π¬") as demo:
|
| 180 |
+
gr.Markdown("# Moul Lmemes π¬")
|
| 181 |
+
gr.Markdown("Write what you are looking for and i will find the most revelant moroccan meme for you π")
|
| 182 |
+
with gr.Tab("Search Memes"):
|
| 183 |
+
search_input = gr.Textbox(label="Type something")
|
| 184 |
+
search_button = gr.Button("Find Meme")
|
| 185 |
+
search_output_video = gr.HTML(label="Top Meme Video")
|
| 186 |
+
search_output_text = gr.Textbox(label="Results")
|
| 187 |
+
search_button.click(
|
|
|
|
|
|
|
| 188 |
fn=query_memes,
|
| 189 |
inputs=search_input,
|
| 190 |
outputs=[search_output_video, search_output_text]
|
| 191 |
)
|
| 192 |
+
gr.Examples(
|
| 193 |
examples=[["a man running"],["sharing"],["immigrant in france"]],
|
| 194 |
inputs=search_input,
|
| 195 |
outputs=[search_output_video, search_output_text],
|