PCBZ commited on
Commit
4a5866f
·
1 Parent(s): 880f233

Add GPU warmup function and update requirements to include 'spaces'

Browse files
Files changed (2) hide show
  1. app.py +6 -0
  2. requirements.txt +1 -0
app.py CHANGED
@@ -3,11 +3,17 @@ import datetime
3
  import requests
4
  import pytz
5
  import yaml
 
6
  from tools.final_answer import FinalAnswerTool
7
  from tools.web_search import DuckDuckGoSearchTool
8
 
9
  from Gradio_UI import GradioUI
10
 
 
 
 
 
 
11
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
12
  @tool
13
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
 
3
  import requests
4
  import pytz
5
  import yaml
6
+ import spaces
7
  from tools.final_answer import FinalAnswerTool
8
  from tools.web_search import DuckDuckGoSearchTool
9
 
10
  from Gradio_UI import GradioUI
11
 
12
+ @spaces.GPU
13
+ def _warmup_gpu():
14
+ """Satisfies HF Spaces' ZeroGPU startup check; this app runs on CPU via the HF Inference API."""
15
+ return True
16
+
17
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
18
  @tool
19
  def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
requirements.txt CHANGED
@@ -3,3 +3,4 @@ smolagents==1.13.0
3
  requests
4
  duckduckgo_search
5
  pandas
 
 
3
  requests
4
  duckduckgo_search
5
  pandas
6
+ spaces