jedick commited on
Commit
cc5c14d
Β·
1 Parent(s): f8c72d3

Lower @spaces.GPU duration

Browse files
Files changed (2) hide show
  1. app.py +3 -3
  2. graph.py +4 -4
app.py CHANGED
@@ -196,7 +196,7 @@ def to_workflow(request: gr.Request, *args):
196
  yield value
197
 
198
 
199
- @spaces.GPU(duration=120)
200
  def run_workflow_local(*args):
201
  for value in run_workflow(*args):
202
  yield value
@@ -356,7 +356,7 @@ with gr.Blocks(
356
  status_text = f"""
357
  πŸ“ Now in **local** mode, using ZeroGPU hardware<br>
358
  βŒ› Response time is around 2 minutes<br>
359
- ✨ [Nomic](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5) embeddings and [{model_id}](https://huggingface.co/{model_id}) LLM<br>
360
  🏠 See the project's [GitHub repository](https://github.com/jedick/R-help-chat)
361
  """
362
  return status_text
@@ -404,7 +404,7 @@ with gr.Blocks(
404
  example_questions = [
405
  # "What is today's date?",
406
  "Summarize emails from the last two months",
407
- "What plotmath examples have been discussed?",
408
  "When was has.HLC mentioned?",
409
  "Who reported installation problems in 2023-2024?",
410
  ]
 
196
  yield value
197
 
198
 
199
+ @spaces.GPU(duration=60)
200
  def run_workflow_local(*args):
201
  for value in run_workflow(*args):
202
  yield value
 
356
  status_text = f"""
357
  πŸ“ Now in **local** mode, using ZeroGPU hardware<br>
358
  βŒ› Response time is around 2 minutes<br>
359
+ ✨ [Nomic](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5) embeddings and [{model_id}](https://huggingface.co/{model_id})<br>
360
  🏠 See the project's [GitHub repository](https://github.com/jedick/R-help-chat)
361
  """
362
  return status_text
 
404
  example_questions = [
405
  # "What is today's date?",
406
  "Summarize emails from the last two months",
407
+ "How to use plotmath?",
408
  "When was has.HLC mentioned?",
409
  "Who reported installation problems in 2023-2024?",
410
  ]
graph.py CHANGED
@@ -223,9 +223,9 @@ def BuildGraph(
223
  if is_local:
224
  # Don't include the system message here because it's defined in ToolCallingLLM
225
  messages = state["messages"]
226
- print_message_summaries(messages, "--- query: before normalization ---")
227
  messages = normalize_messages(messages)
228
- print_message_summaries(messages, "--- query: after normalization ---")
229
  else:
230
  messages = [SystemMessage(query_prompt(compute_mode))] + state["messages"]
231
  response = query_model.invoke(messages)
@@ -236,13 +236,13 @@ def BuildGraph(
236
  """Generates an answer with the chat model"""
237
  if is_local:
238
  messages = state["messages"]
239
- print_message_summaries(messages, "--- generate: before normalization ---")
240
  messages = normalize_messages(messages)
241
  # Add the system message here because we're not using tools
242
  messages = [
243
  SystemMessage(generate_prompt(with_tools=False, think=False))
244
  ] + messages
245
- print_message_summaries(messages, "--- generate: after normalization ---")
246
  else:
247
  messages = [SystemMessage(generate_prompt())] + state["messages"]
248
  response = generate_model.invoke(messages)
 
223
  if is_local:
224
  # Don't include the system message here because it's defined in ToolCallingLLM
225
  messages = state["messages"]
226
+ # print_message_summaries(messages, "--- query: before normalization ---")
227
  messages = normalize_messages(messages)
228
+ # print_message_summaries(messages, "--- query: after normalization ---")
229
  else:
230
  messages = [SystemMessage(query_prompt(compute_mode))] + state["messages"]
231
  response = query_model.invoke(messages)
 
236
  """Generates an answer with the chat model"""
237
  if is_local:
238
  messages = state["messages"]
239
+ # print_message_summaries(messages, "--- generate: before normalization ---")
240
  messages = normalize_messages(messages)
241
  # Add the system message here because we're not using tools
242
  messages = [
243
  SystemMessage(generate_prompt(with_tools=False, think=False))
244
  ] + messages
245
+ # print_message_summaries(messages, "--- generate: after normalization ---")
246
  else:
247
  messages = [SystemMessage(generate_prompt())] + state["messages"]
248
  response = generate_model.invoke(messages)