Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files- Dockerfile +0 -37
- README.md +1 -1
- app.py +24 -0
- requirements.txt +35 -0
Dockerfile
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 2 |
-
# OpenManus Dockerfile for HuggingΒ Face *Docker* Space + Gradio
|
| 3 |
-
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 4 |
-
|
| 5 |
-
FROM python:3.12-slim
|
| 6 |
-
|
| 7 |
-
# 1) OS packages + uv (old --prerelease flag compatible)
|
| 8 |
-
RUN apt-get update && apt-get install -y --no-install-recommends unzip && \
|
| 9 |
-
rm -rf /var/lib/apt/lists/* && \
|
| 10 |
-
pip install --no-cache-dir uv==0.6.13
|
| 11 |
-
|
| 12 |
-
# 2) copy everything in the Space repo
|
| 13 |
-
WORKDIR /app
|
| 14 |
-
COPY . /app
|
| 15 |
-
|
| 16 |
-
# 3) unzip the GitHub archive (if you uploaded the raw folder, this is a noβop)
|
| 17 |
-
RUN if [ -f OpenManus-main.zip ]; then \
|
| 18 |
-
unzip OpenManus-main.zip && mv OpenManus-main OpenManus ; \
|
| 19 |
-
fi
|
| 20 |
-
|
| 21 |
-
# 4) make sure logs dir is writable by HF's nonβroot user (uid 1000)
|
| 22 |
-
RUN mkdir -p /app/OpenManus/logs && \
|
| 23 |
-
chown -R 1000:1000 /app/OpenManus
|
| 24 |
-
|
| 25 |
-
# 5) install Python deps (project + gradio UI)
|
| 26 |
-
WORKDIR /app/OpenManus
|
| 27 |
-
RUN uv pip install --system -r requirements.txt && \
|
| 28 |
-
pip install --no-cache-dir "gradio>=4"
|
| 29 |
-
|
| 30 |
-
# 6) ship default config so the agent can start
|
| 31 |
-
RUN cp config/config.example.toml config/config.toml
|
| 32 |
-
|
| 33 |
-
# 7) expose the web UI port for HuggingΒ Face
|
| 34 |
-
EXPOSE 7860
|
| 35 |
-
|
| 36 |
-
# 8) launch the Gradio wrapper
|
| 37 |
-
CMD ["python", "serve.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -3,7 +3,7 @@ title: Openmanusdemo # optional
|
|
| 3 |
emoji: ποΈ # optional
|
| 4 |
colorFrom: indigo # optional
|
| 5 |
colorTo: green # optional
|
| 6 |
-
sdk:
|
| 7 |
app_port: 7860 # π this is the only line that really matters
|
| 8 |
pinned: false
|
| 9 |
---
|
|
|
|
| 3 |
emoji: ποΈ # optional
|
| 4 |
colorFrom: indigo # optional
|
| 5 |
colorTo: green # optional
|
| 6 |
+
sdk: gradio
|
| 7 |
app_port: 7860 # π this is the only line that really matters
|
| 8 |
pinned: false
|
| 9 |
---
|
app.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import asyncio
|
| 2 |
+
import os
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
from OpenManus.app.agent.manus import Manus # OpenManus import
|
| 6 |
+
|
| 7 |
+
# If you have a config helper, load it here; otherwise instantiate directly
|
| 8 |
+
agent = Manus()
|
| 9 |
+
|
| 10 |
+
async def chat_fn(message, history):
|
| 11 |
+
"""Gradio chat callback."""
|
| 12 |
+
reply = await agent.run(message)
|
| 13 |
+
return reply
|
| 14 |
+
|
| 15 |
+
demo = gr.ChatInterface(
|
| 16 |
+
fn=chat_fn,
|
| 17 |
+
title="OpenManus",
|
| 18 |
+
stop_btn="Stop",
|
| 19 |
+
retry_btn="Retry",
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
if __name__ == "__main__":
|
| 23 |
+
# HF Spaces autoβbinds to the correct host/port
|
| 24 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
requirements.txt
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
datasets~=3.4.1
|
| 2 |
+
duckduckgo_search~=7.5.3
|
| 3 |
+
loguru~=0.7.3
|
| 4 |
+
tiktoken~=0.9.0
|
| 5 |
+
unidiff~=0.7.5
|
| 6 |
+
huggingface-hub~=0.29.2
|
| 7 |
+
numpy
|
| 8 |
+
pydantic_core~=2.27.2
|
| 9 |
+
pydantic~=2.10.6
|
| 10 |
+
browser-use~=0.1.40
|
| 11 |
+
browsergym~=0.13.3
|
| 12 |
+
gradio>=4.0.0
|
| 13 |
+
tomli>=2.0.0
|
| 14 |
+
docker~=7.1.0
|
| 15 |
+
baidusearch~=1.0.3
|
| 16 |
+
tenacity~=9.0.0
|
| 17 |
+
openai~=1.66.3
|
| 18 |
+
beautifulsoup4~=4.13.3
|
| 19 |
+
uvicorn~=0.34.0
|
| 20 |
+
playwright~=1.51.0
|
| 21 |
+
aiofiles~=24.1.0
|
| 22 |
+
httpx>=0.27.0
|
| 23 |
+
mcp~=1.5.0
|
| 24 |
+
gymnasium~=1.1.1
|
| 25 |
+
pytest~=8.3.5
|
| 26 |
+
pillow~=11.1.0
|
| 27 |
+
colorama~=0.4.6
|
| 28 |
+
requests~=2.32.3
|
| 29 |
+
googlesearch-python~=1.3.0
|
| 30 |
+
setuptools~=75.8.0
|
| 31 |
+
fastapi~=0.115.11
|
| 32 |
+
pytest-asyncio~=0.25.3
|
| 33 |
+
boto3~=1.37.18
|
| 34 |
+
html2text~=2024.2.26
|
| 35 |
+
pyyaml~=6.0.2
|