Spaces:
Sleeping
Sleeping
fix f string
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from qwen_classifier.evaluate import evaluate_batch # Your existing function
|
|
10 |
import torch
|
11 |
from huggingface_hub import login
|
12 |
from qwen_classifier.model import QwenClassifier
|
13 |
-
from qwen_classifier.config import HF_REPO
|
14 |
from pydantic import BaseModel
|
15 |
|
16 |
app = FastAPI(title="Qwen Classifier")
|
@@ -18,7 +18,7 @@ app = FastAPI(title="Qwen Classifier")
|
|
18 |
# Add this endpoint
|
19 |
@app.get("/", response_class=HTMLResponse)
|
20 |
def home():
|
21 |
-
return
|
22 |
<html>
|
23 |
<head>
|
24 |
<title>Qwen Classifier</title>
|
@@ -31,7 +31,7 @@ def home():
|
|
31 |
<li><strong>POST /evaluate</strong> - Evaluate batch text prediction from zip file</li>
|
32 |
<li><strong>GET /health</strong> - Check API status</li>
|
33 |
</ul>
|
34 |
-
<p>Try it: <code>curl -X POST
|
35 |
</body>
|
36 |
</html>
|
37 |
"""
|
|
|
10 |
import torch
|
11 |
from huggingface_hub import login
|
12 |
from qwen_classifier.model import QwenClassifier
|
13 |
+
from qwen_classifier.config import HF_REPO
|
14 |
from pydantic import BaseModel
|
15 |
|
16 |
app = FastAPI(title="Qwen Classifier")
|
|
|
18 |
# Add this endpoint
|
19 |
@app.get("/", response_class=HTMLResponse)
|
20 |
def home():
|
21 |
+
return """
|
22 |
<html>
|
23 |
<head>
|
24 |
<title>Qwen Classifier</title>
|
|
|
31 |
<li><strong>POST /evaluate</strong> - Evaluate batch text prediction from zip file</li>
|
32 |
<li><strong>GET /health</strong> - Check API status</li>
|
33 |
</ul>
|
34 |
+
<p>Try it: <code>curl -X POST <SPACE_URL>/predict -H "Content-Type: application/json" -d '{"text":"your text"}'</code></p>
|
35 |
</body>
|
36 |
</html>
|
37 |
"""
|