Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,3 +8,67 @@ pinned: false
|
|
| 8 |
---
|
| 9 |
|
| 10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
To interact with your FastAPI application using curl, you can use the following commands. The base URL for your API is https://shakeel143-sbburaflaskapi.hf.space.
|
| 16 |
+
|
| 17 |
+
1. Health Check
|
| 18 |
+
Endpoint: /health
|
| 19 |
+
Method: GET
|
| 20 |
+
Curl Command:
|
| 21 |
+
curl -X GET "https://shakeel143-sbburaflaskapi.hf.space/health"
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
2. Root Endpoint
|
| 25 |
+
Endpoint: /
|
| 26 |
+
Method: GET
|
| 27 |
+
Curl Command:
|
| 28 |
+
curl -X GET "https://shakeel143-sbburaflaskapi.hf.space/"
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
3. List Available Models
|
| 32 |
+
Endpoint: /available-models
|
| 33 |
+
Method: GET
|
| 34 |
+
Curl Command:
|
| 35 |
+
curl -X GET "https://shakeel143-sbburaflaskapi.hf.space/available-models"
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
4. Load a Model
|
| 39 |
+
Endpoint: /load-model/
|
| 40 |
+
Method: POST
|
| 41 |
+
Body: JSON with model_name and optional temperature
|
| 42 |
+
Curl Command:
|
| 43 |
+
curl -X POST "https://shakeel143-sbburaflaskapi.hf.space/load-model/" \
|
| 44 |
+
-H "Content-Type: application/json" \
|
| 45 |
+
-d '{"model_name": "your_model_name", "temperature": 0.7}'
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
5. Chat with a Loaded Model
|
| 49 |
+
Endpoint: /chat/{model_name}
|
| 50 |
+
Method: POST
|
| 51 |
+
Body: JSON with question
|
| 52 |
+
Curl Command:
|
| 53 |
+
curl -X POST "https://shakeel143-sbburaflaskapi.hf.space/chat/your_model_name" \
|
| 54 |
+
-H "Content-Type: application/json" \
|
| 55 |
+
-d '{"question": "Your question here"}'
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
Example Usage
|
| 61 |
+
|
| 62 |
+
Health Check:
|
| 63 |
+
curl -X GET "https://shakeel143-sbburaflaskapi.hf.space/health"
|
| 64 |
+
|
| 65 |
+
Load a Model:
|
| 66 |
+
curl -X POST "https://shakeel143-sbburaflaskapi.hf.space/load-model/" \
|
| 67 |
+
-H "Content-Type: application/json" \
|
| 68 |
+
-d '{"model_name": "example_model", "temperature": 0.7}'
|
| 69 |
+
|
| 70 |
+
Chat with a Loaded Model:
|
| 71 |
+
|
| 72 |
+
curl -X POST "https://shakeel143-sbburaflaskapi.hf.space/chat/example_model" \
|
| 73 |
+
-H "Content-Type: application/json" \
|
| 74 |
+
-d '{"question": "What is the capital of France?"}'
|