Spaces:
Sleeping
Sleeping
Commit ·
e7e750b
1
Parent(s): 24ee997
Switch to SmolLM2 (HF Native) to resolve provider support issues
Browse files- PROJECT_DOCS.md +1 -1
- services/analyzer.py +3 -3
PROJECT_DOCS.md
CHANGED
|
@@ -20,7 +20,7 @@ We used the following technologies to build this application from scratch:
|
|
| 20 |
| Component | Technology | Purpose |
|
| 21 |
| :--- | :--- | :--- |
|
| 22 |
| **Framework** | **FastAPI** | High-performance web framework for building the API endpoints. |
|
| 23 |
-
| **AI Model** | **
|
| 24 |
| **Connection** | **HF Inference Client** | Connects to Hugging Face's serverless GPU cluster. |
|
| 25 |
| **Container** | **Docker** | Lightweight container (no heavy ML libraries needed anymore). |
|
| 26 |
| **Deployment** | **Hugging Face Spaces** | The cloud platform hosting the Docker container. |
|
|
|
|
| 20 |
| Component | Technology | Purpose |
|
| 21 |
| :--- | :--- | :--- |
|
| 22 |
| **Framework** | **FastAPI** | High-performance web framework for building the API endpoints. |
|
| 23 |
+
| **AI Model** | **SmolLM2-1.7B-Instruct** | Hugging Face's own efficient model, ensuring maximum free-tier compatibility. |
|
| 24 |
| **Connection** | **HF Inference Client** | Connects to Hugging Face's serverless GPU cluster. |
|
| 25 |
| **Container** | **Docker** | Lightweight container (no heavy ML libraries needed anymore). |
|
| 26 |
| **Deployment** | **Hugging Face Spaces** | The cloud platform hosting the Docker container. |
|
services/analyzer.py
CHANGED
|
@@ -9,8 +9,8 @@ env_path = Path(__file__).resolve().parent.parent.parent / ".env"
|
|
| 9 |
load_dotenv(dotenv_path=env_path)
|
| 10 |
|
| 11 |
# Configuration: Use a powerful model available via free Serverless API
|
| 12 |
-
#
|
| 13 |
-
MODEL_ID = "
|
| 14 |
|
| 15 |
# Initialize Client
|
| 16 |
# It automatically picks up HF_TOKEN from environment if set, otherwise works anonymously (with lower limits)
|
|
@@ -107,7 +107,7 @@ def analyze_seo_content(content: str) -> dict:
|
|
| 107 |
try:
|
| 108 |
response = client.chat_completion(
|
| 109 |
messages=messages,
|
| 110 |
-
max_tokens=
|
| 111 |
temperature=0.7,
|
| 112 |
top_p=0.9
|
| 113 |
)
|
|
|
|
| 9 |
load_dotenv(dotenv_path=env_path)
|
| 10 |
|
| 11 |
# Configuration: Use a powerful model available via free Serverless API
|
| 12 |
+
# SmolLM2 is Hugging Face's own efficient model - highly likely to be supported free.
|
| 13 |
+
MODEL_ID = "HuggingFaceTB/SmolLM2-1.7B-Instruct"
|
| 14 |
|
| 15 |
# Initialize Client
|
| 16 |
# It automatically picks up HF_TOKEN from environment if set, otherwise works anonymously (with lower limits)
|
|
|
|
| 107 |
try:
|
| 108 |
response = client.chat_completion(
|
| 109 |
messages=messages,
|
| 110 |
+
max_tokens=2000,
|
| 111 |
temperature=0.7,
|
| 112 |
top_p=0.9
|
| 113 |
)
|