Spaces:
Sleeping
Sleeping
Update run.py
Browse files
run.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
from fastapi import FastAPI, Query
|
| 2 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
| 3 |
from qwen_vl_utils import process_vision_info
|
|
@@ -22,7 +23,9 @@ model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
|
| 22 |
|
| 23 |
@app.get("/")
|
| 24 |
def read_root():
|
| 25 |
-
return {
|
|
|
|
|
|
|
| 26 |
import requests
|
| 27 |
|
| 28 |
url = "https://<uname>-<spacename>.hf.space/predict"
|
|
|
|
| 1 |
+
import os
|
| 2 |
from fastapi import FastAPI, Query
|
| 3 |
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
|
| 4 |
from qwen_vl_utils import process_vision_info
|
|
|
|
| 23 |
|
| 24 |
@app.get("/")
|
| 25 |
def read_root():
|
| 26 |
+
return {
|
| 27 |
+
"api_url": os.getenv("HF_INFERENCE_ENDPOINT", "") + "/predict",
|
| 28 |
+
"message": "API is live. Use the /predict endpoint.", "code": """
|
| 29 |
import requests
|
| 30 |
|
| 31 |
url = "https://<uname>-<spacename>.hf.space/predict"
|