somthinf
Browse files- app.py +6 -12
- chatbot_page.py +3 -3
app.py
CHANGED
@@ -385,14 +385,11 @@ with gr.Blocks() as demo:
|
|
385 |
combined_txt_results = gr.Textbox(label="Combined Repo Files", lines=20)
|
386 |
llm_output_txt_results = gr.Textbox(label="LLM Analysis Output", lines=10)
|
387 |
back_to_start_btn4 = gr.Button("Back to Start")
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
# Add a button to show top 3 in chat
|
395 |
-
show_top3_chat_btn = gr.Button("Show Top 3 Repo IDs in Chat", visible=True)
|
396 |
|
397 |
# Navigation logic
|
398 |
option_a_btn.click(go_to_input, inputs=None, outputs=[start_page, input_page, chatbot_page, results_page])
|
@@ -439,11 +436,8 @@ with gr.Blocks() as demo:
|
|
439 |
|
440 |
# Add logic for the new button on results_page
|
441 |
analyze_next_btn.click(show_combined_repo_and_llm, inputs=None, outputs=[combined_txt_results, llm_output_txt_results, results_df])
|
442 |
-
|
443 |
-
# Add logic for the batch button
|
444 |
batch_btn.click(batch_analyze_and_select_top, inputs=None, outputs=[batch_info_txt, top3_txt, df_output])
|
445 |
-
|
446 |
-
# Add logic for showing top 3 in chat
|
447 |
show_top3_chat_btn.click(batch_analyze_and_select_top_for_chat, inputs=[state], outputs=[state])
|
448 |
|
449 |
demo.launch()
|
|
|
385 |
combined_txt_results = gr.Textbox(label="Combined Repo Files", lines=20)
|
386 |
llm_output_txt_results = gr.Textbox(label="LLM Analysis Output", lines=10)
|
387 |
back_to_start_btn4 = gr.Button("Back to Start")
|
388 |
+
# Batch analyze and show top 3 only on results page
|
389 |
+
batch_btn = gr.Button("Batch Analyze All & Select Top 3", visible=True)
|
390 |
+
batch_info_txt = gr.Textbox(label="All Repo Analyses", lines=10)
|
391 |
+
top3_txt = gr.Textbox(label="Top 3 Repo IDs", lines=1)
|
392 |
+
show_top3_chat_btn = gr.Button("Show Top 3 Repo IDs in Chat", visible=True)
|
|
|
|
|
|
|
393 |
|
394 |
# Navigation logic
|
395 |
option_a_btn.click(go_to_input, inputs=None, outputs=[start_page, input_page, chatbot_page, results_page])
|
|
|
436 |
|
437 |
# Add logic for the new button on results_page
|
438 |
analyze_next_btn.click(show_combined_repo_and_llm, inputs=None, outputs=[combined_txt_results, llm_output_txt_results, results_df])
|
439 |
+
# Batch analyze and show top 3 logic (now only on results page)
|
|
|
440 |
batch_btn.click(batch_analyze_and_select_top, inputs=None, outputs=[batch_info_txt, top3_txt, df_output])
|
|
|
|
|
441 |
show_top3_chat_btn.click(batch_analyze_and_select_top_for_chat, inputs=[state], outputs=[state])
|
442 |
|
443 |
demo.launch()
|
chatbot_page.py
CHANGED
@@ -5,8 +5,8 @@ import os
|
|
5 |
# System prompt for the chatbot
|
6 |
CHATBOT_SYSTEM_PROMPT = (
|
7 |
"You are a helpful assistant. Your goal is to help the user describe their ideal Hugging face repo. "
|
8 |
-
"Ask questions to clarify what they want, their use case,
|
9 |
-
"When the user clicks 'End Chat', analyze the conversation and return
|
10 |
"Return only the keywords as a comma-separated list."
|
11 |
)
|
12 |
|
@@ -70,7 +70,7 @@ with gr.Blocks() as chatbot_demo:
|
|
70 |
gr.Markdown("## Repo Recommendation Chatbot")
|
71 |
chatbot = gr.Chatbot()
|
72 |
# Initial assistant message
|
73 |
-
initial_message = "Hello!
|
74 |
state = gr.State([["", initial_message]]) # Start with assistant message
|
75 |
user_input = gr.Textbox(label="Your message", placeholder="Describe your ideal repo or answer the assistant's questions...")
|
76 |
send_btn = gr.Button("Send")
|
|
|
5 |
# System prompt for the chatbot
|
6 |
CHATBOT_SYSTEM_PROMPT = (
|
7 |
"You are a helpful assistant. Your goal is to help the user describe their ideal Hugging face repo. "
|
8 |
+
"Ask questions to clarify what they want, their use case,features, etc. "
|
9 |
+
"When the user clicks 'End Chat', analyze the conversation and return 1 to 5 keywords for repo search. "
|
10 |
"Return only the keywords as a comma-separated list."
|
11 |
)
|
12 |
|
|
|
70 |
gr.Markdown("## Repo Recommendation Chatbot")
|
71 |
chatbot = gr.Chatbot()
|
72 |
# Initial assistant message
|
73 |
+
initial_message = "Hello! Please tell me about your ideal Hugging Face repo. What use case, preferred language, or features are you looking for?"
|
74 |
state = gr.State([["", initial_message]]) # Start with assistant message
|
75 |
user_input = gr.Textbox(label="Your message", placeholder="Describe your ideal repo or answer the assistant's questions...")
|
76 |
send_btn = gr.Button("Send")
|