Spaces:
Running
Running
dragonjump
commited on
Commit
·
1347859
1
Parent(s):
9559a52
update'
Browse files- Dockerfile +1 -0
- README.md +6 -0
- main.py.old +1 -0
Dockerfile
CHANGED
@@ -18,6 +18,7 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
18 |
torchvision \
|
19 |
git+https://github.com/huggingface/transformers \
|
20 |
accelerate \
|
|
|
21 |
qwen-vl-utils[decord]==0.0.8 \
|
22 |
fastapi \
|
23 |
uvicorn[standard]
|
|
|
18 |
torchvision \
|
19 |
git+https://github.com/huggingface/transformers \
|
20 |
accelerate \
|
21 |
+
transformers \
|
22 |
qwen-vl-utils[decord]==0.0.8 \
|
23 |
fastapi \
|
24 |
uvicorn[standard]
|
README.md
CHANGED
@@ -8,6 +8,12 @@ pinned: false
|
|
8 |
license: apache-2.0
|
9 |
---
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
12 |
|
13 |
|
|
|
8 |
license: apache-2.0
|
9 |
---
|
10 |
|
11 |
+
curl -X GET "http://localhost:8000/predict?image_url=https://example.com/sample-image.jpg&prompt=Describe%20the%20contents%20of%20this%20image." -H "accept: application/json"
|
12 |
+
|
13 |
+
curl -X GET "http://localhost:8000/chat?prompt=Hello%20there%2C%20how%20are%20you%3F" -H "accept: application/json"
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
18 |
|
19 |
|
main.py.old
CHANGED
@@ -36,6 +36,7 @@ def read_root():
|
|
36 |
|
37 |
@app.get("/predict")
|
38 |
def predict(image_url: str = Query(...), prompt: str = Query(...)):
|
|
|
39 |
messages = [
|
40 |
{"role": "system", "content": "You are a helpful assistant with vision abilities."},
|
41 |
{"role": "user", "content": [{"type": "image", "image": image_url}, {"type": "text", "text": prompt}]},
|
|
|
36 |
|
37 |
@app.get("/predict")
|
38 |
def predict(image_url: str = Query(...), prompt: str = Query(...)):
|
39 |
+
|
40 |
messages = [
|
41 |
{"role": "system", "content": "You are a helpful assistant with vision abilities."},
|
42 |
{"role": "user", "content": [{"type": "image", "image": image_url}, {"type": "text", "text": prompt}]},
|