cjell
commited on
Commit
·
9997478
1
Parent(s):
c5e6b07
first
Browse files- Dockerfile +12 -0
- app.py +0 -0
- requirements.txt +0 -0
- test.py +13 -0
Dockerfile
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11
|
| 2 |
+
|
| 3 |
+
WORKDIR /code
|
| 4 |
+
|
| 5 |
+
COPY requirements.txt .
|
| 6 |
+
|
| 7 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 8 |
+
|
| 9 |
+
COPY . .
|
| 10 |
+
|
| 11 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 12 |
+
|
app.py
ADDED
|
File without changes
|
requirements.txt
ADDED
|
File without changes
|
test.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
|
| 3 |
+
url = "https://cjell-Demo.hf.space/predict"
|
| 4 |
+
|
| 5 |
+
payload = {"text": "Congragulations you have won $1000"}
|
| 6 |
+
|
| 7 |
+
response = requests.post(url, json=payload)
|
| 8 |
+
|
| 9 |
+
print("Status:", response.status_code)
|
| 10 |
+
try:
|
| 11 |
+
print("JSON:", response.json())
|
| 12 |
+
except Exception:
|
| 13 |
+
print("Raw text:", response.text)
|