Spaces:
Sleeping
Sleeping
uru commited on
Commit ·
235c220
1
Parent(s): 36b2ecf
Structural changes: moved Gradio_UI.py to src/first_agent/ui.py
Browse files- .env.example +1 -0
- .gitignore +48 -47
- app.py +9 -0
- requirements.txt +1 -0
.env.example
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
HF_TOKEN=hf_xxx
|
.gitignore
CHANGED
|
@@ -1,74 +1,75 @@
|
|
| 1 |
-
# ==========
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
.
|
| 5 |
-
.AppleDouble
|
| 6 |
-
.LSOverride
|
| 7 |
-
Icon?
|
| 8 |
-
._*
|
| 9 |
|
| 10 |
-
# ==========
|
| 11 |
-
# Python
|
| 12 |
-
# =========================
|
| 13 |
__pycache__/
|
| 14 |
*.py[cod]
|
| 15 |
*$py.class
|
| 16 |
|
| 17 |
-
# Virtual environments
|
| 18 |
.venv/
|
| 19 |
venv/
|
| 20 |
env/
|
| 21 |
ENV/
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
#
|
| 24 |
build/
|
| 25 |
dist/
|
| 26 |
*.egg-info/
|
| 27 |
.eggs/
|
|
|
|
| 28 |
|
| 29 |
-
#
|
| 30 |
.pytest_cache/
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
.coverage
|
| 32 |
htmlcov/
|
| 33 |
|
| 34 |
-
#
|
| 35 |
-
|
| 36 |
|
| 37 |
-
# ==========
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
.
|
| 41 |
-
.env.*
|
| 42 |
-
!.env.example
|
| 43 |
-
|
| 44 |
-
# =========================
|
| 45 |
-
# IDEs
|
| 46 |
-
# =========================
|
| 47 |
|
| 48 |
-
#
|
| 49 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
-
#
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
#
|
| 55 |
-
# Xcode
|
| 56 |
-
# =========================
|
| 57 |
DerivedData/
|
| 58 |
build/
|
| 59 |
-
*.
|
| 60 |
-
*.
|
| 61 |
-
*.
|
| 62 |
-
*.
|
| 63 |
-
*.xcodeproj/project.xcworkspace/
|
| 64 |
-
*.xcodeproj/xcuserdata/
|
| 65 |
|
| 66 |
-
#
|
| 67 |
-
.
|
|
|
|
| 68 |
|
| 69 |
-
#
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
hf_cache/
|
| 74 |
-
.cache/
|
|
|
|
| 1 |
+
# ===== Secrets / env =====
|
| 2 |
+
.env
|
| 3 |
+
.env.*
|
| 4 |
+
!.env.example
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
+
# ===== Python =====
|
|
|
|
|
|
|
| 7 |
__pycache__/
|
| 8 |
*.py[cod]
|
| 9 |
*$py.class
|
| 10 |
|
|
|
|
| 11 |
.venv/
|
| 12 |
venv/
|
| 13 |
env/
|
| 14 |
ENV/
|
| 15 |
+
pip-wheel-metadata/
|
| 16 |
+
pip-log.txt
|
| 17 |
+
pip-delete-this-directory.txt
|
| 18 |
|
| 19 |
+
# build / dist
|
| 20 |
build/
|
| 21 |
dist/
|
| 22 |
*.egg-info/
|
| 23 |
.eggs/
|
| 24 |
+
wheels/
|
| 25 |
|
| 26 |
+
# tooling caches
|
| 27 |
.pytest_cache/
|
| 28 |
+
.mypy_cache/
|
| 29 |
+
.ruff_cache/
|
| 30 |
+
.cache/
|
| 31 |
+
coverage.xml
|
| 32 |
.coverage
|
| 33 |
htmlcov/
|
| 34 |
|
| 35 |
+
# Jupyter / notebooks
|
| 36 |
+
.ipynb_checkpoints/
|
| 37 |
|
| 38 |
+
# ===== Gradio / HF artifacts =====
|
| 39 |
+
.gradio/
|
| 40 |
+
tmp/
|
| 41 |
+
*.log
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
# ===== macOS =====
|
| 44 |
+
.DS_Store
|
| 45 |
+
.AppleDouble
|
| 46 |
+
.LSOverride
|
| 47 |
+
Icon?
|
| 48 |
+
._*
|
| 49 |
+
.Spotlight-V100
|
| 50 |
+
.Trashes
|
| 51 |
+
.fseventsd
|
| 52 |
|
| 53 |
+
# ===== Xcode =====
|
| 54 |
+
# User-specific settings
|
| 55 |
+
xcuserdata/
|
| 56 |
+
*.xcuserstate
|
| 57 |
+
*.xccheckout
|
| 58 |
+
*.xcscmblueprint
|
| 59 |
|
| 60 |
+
# Build products
|
|
|
|
|
|
|
| 61 |
DerivedData/
|
| 62 |
build/
|
| 63 |
+
*.ipa
|
| 64 |
+
*.dSYM
|
| 65 |
+
*.dSYM.zip
|
| 66 |
+
*.dSYM.tar.gz
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
# SwiftPM / Xcode integration
|
| 69 |
+
.swiftpm/
|
| 70 |
+
Package.resolved
|
| 71 |
|
| 72 |
+
# Carthage / CocoaPods (если вдруг появятся)
|
| 73 |
+
Carthage/Build/
|
| 74 |
+
Pods/
|
| 75 |
+
Podfile.lock
|
|
|
|
|
|
app.py
CHANGED
|
@@ -61,6 +61,15 @@ final_answer = FinalAnswerTool()
|
|
| 61 |
web_search = DuckDuckGoSearchTool(max_results=10)
|
| 62 |
visit_webpage = VisitWebpageTool()
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 65 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 66 |
|
|
|
|
| 61 |
web_search = DuckDuckGoSearchTool(max_results=10)
|
| 62 |
visit_webpage = VisitWebpageTool()
|
| 63 |
|
| 64 |
+
import os
|
| 65 |
+
try:
|
| 66 |
+
from dotenv import load_dotenv
|
| 67 |
+
load_dotenv()
|
| 68 |
+
except Exception:
|
| 69 |
+
# On HF this is not necessary; there you can access env from Settings → Secrets
|
| 70 |
+
pass
|
| 71 |
+
|
| 72 |
+
|
| 73 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 74 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 75 |
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
smolagents==1.13.0
|
| 2 |
gradio==6.5.1
|
| 3 |
requests
|
|
|
|
| 1 |
+
python-dotenv
|
| 2 |
smolagents==1.13.0
|
| 3 |
gradio==6.5.1
|
| 4 |
requests
|