Update app.py
#1
by zzz6519003 - opened
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import requests
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
|
|
|
| 7 |
|
| 8 |
from Gradio_UI import GradioUI
|
| 9 |
|
|
@@ -66,4 +67,10 @@ agent = CodeAgent(
|
|
| 66 |
)
|
| 67 |
|
| 68 |
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
from tools.final_answer import FinalAnswerTool
|
| 7 |
+
import spaces
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
| 10 |
|
|
|
|
| 67 |
)
|
| 68 |
|
| 69 |
|
| 70 |
+
# ======适配HF ZeroGPU强制要求,新增包装函数======
|
| 71 |
+
@spaces.GPU()
|
| 72 |
+
def launch_app():
|
| 73 |
+
GradioUI(agent).launch(server_name="0.0.0.0", server_port=7860)
|
| 74 |
+
|
| 75 |
+
if __name__ == "__main__":
|
| 76 |
+
launch_app()
|