riyamalshe commited on
Commit
a9c6987
·
verified ·
1 Parent(s): 3c3edd4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -108,22 +108,6 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
108
 
109
  client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
110
 
111
- with gr.Blocks() as chatbot:
112
- with gr.Row():
113
- cool_button = gr.Button("Cool Mom")
114
- tutor_button = gr.Button("Tutor Mom")
115
- strict_button = gr.Button("Strict Mom")
116
-
117
- cool_button.click(fn=[], inputs=[], outputs=respond(message, history, "Cool Mom"))
118
- tutor_button.click(fn=[], inputs=[], outputs=respond(message, history, "Tutor Mom"))
119
- strict_button.click(fn=[], inputs=[], outputs=respond(message, history, "Strict Mom"))
120
-
121
- gr.ChatInterface(
122
- #fn=respond,
123
- #additional_inputs=[mom_type],
124
- title="StudyMama"
125
- )
126
-
127
  def respond(message, history, mom_type):
128
  top_cool_results = get_top_chunks(message, cool_chunk_embeddings, cleaned_cool_chunks) # Complete this line
129
  top_tutor_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
@@ -163,6 +147,23 @@ def respond(message, history, mom_type):
163
 
164
  chatbot = gr.ChatInterface(respond, type="messages")
165
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  #def respond_tutor(message, history, mom_type):
167
  # top_tutor_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
168
  # #str_chunks = "\n".join(best_chunks)
 
108
 
109
  client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  def respond(message, history, mom_type):
112
  top_cool_results = get_top_chunks(message, cool_chunk_embeddings, cleaned_cool_chunks) # Complete this line
113
  top_tutor_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
 
147
 
148
  chatbot = gr.ChatInterface(respond, type="messages")
149
 
150
+ with gr.Blocks() as chatbot:
151
+ with gr.Row():
152
+ cool_button = gr.Button("Cool Mom")
153
+ tutor_button = gr.Button("Tutor Mom")
154
+ strict_button = gr.Button("Strict Mom")
155
+
156
+ cool_button.click(fn=[], inputs=[], outputs=respond(message, history, "Cool Mom"))
157
+ tutor_button.click(fn=[], inputs=[], outputs=respond(message, history, "Tutor Mom"))
158
+ strict_button.click(fn=[], inputs=[], outputs=respond(message, history, "Strict Mom"))
159
+
160
+ gr.ChatInterface(
161
+ #fn=respond,
162
+ #additional_inputs=[mom_type],
163
+ title="StudyMama"
164
+ )
165
+
166
+
167
  #def respond_tutor(message, history, mom_type):
168
  # top_tutor_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
169
  # #str_chunks = "\n".join(best_chunks)