Instructions to use AnalyticsIntelligence/PIDGIN_gemma3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnalyticsIntelligence/PIDGIN_gemma3 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AnalyticsIntelligence/PIDGIN_gemma3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
Update handler.py
Browse files- handler.py +2 -2
handler.py
CHANGED
|
@@ -5,7 +5,7 @@ import torch
|
|
| 5 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 6 |
from huggingface_inference_toolkit.logging import logger
|
| 7 |
|
| 8 |
-
|
| 9 |
class EndpointHandler:
|
| 10 |
"""
|
| 11 |
Custom handler for Hugging Face Inference Endpoints.
|
|
@@ -25,7 +25,7 @@ class EndpointHandler:
|
|
| 25 |
self.model = AutoModelForCausalLM.from_pretrained(model_dir)
|
| 26 |
except Exception as e:
|
| 27 |
# fallback: try loading from hub name
|
| 28 |
-
hf_model_id =
|
| 29 |
logger.warn(f"Loading model from hub id {hf_model_id} because fallback. Exception: {e}")
|
| 30 |
self.tokenizer = AutoTokenizer.from_pretrained(hf_model_id, use_fast=False)
|
| 31 |
self.model = AutoModelForCausalLM.from_pretrained(hf_model_id)
|
|
|
|
| 5 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 6 |
from huggingface_inference_toolkit.logging import logger
|
| 7 |
|
| 8 |
+
model_dir = 'Ephraimmm/PIDGIN_gemma-3'
|
| 9 |
class EndpointHandler:
|
| 10 |
"""
|
| 11 |
Custom handler for Hugging Face Inference Endpoints.
|
|
|
|
| 25 |
self.model = AutoModelForCausalLM.from_pretrained(model_dir)
|
| 26 |
except Exception as e:
|
| 27 |
# fallback: try loading from hub name
|
| 28 |
+
hf_model_id = "Ephraimmm/PIDGIN_gemma-3"
|
| 29 |
logger.warn(f"Loading model from hub id {hf_model_id} because fallback. Exception: {e}")
|
| 30 |
self.tokenizer = AutoTokenizer.from_pretrained(hf_model_id, use_fast=False)
|
| 31 |
self.model = AutoModelForCausalLM.from_pretrained(hf_model_id)
|