Instructions to use Kowsher/TokenTrails with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kowsher/TokenTrails with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kowsher/TokenTrails", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kowsher/TokenTrails", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Kowsher/TokenTrails", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kowsher/TokenTrails with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kowsher/TokenTrails" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kowsher/TokenTrails", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kowsher/TokenTrails
- SGLang
How to use Kowsher/TokenTrails with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Kowsher/TokenTrails" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kowsher/TokenTrails", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Kowsher/TokenTrails" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kowsher/TokenTrails", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kowsher/TokenTrails with Docker Model Runner:
docker model run hf.co/Kowsher/TokenTrails
Update ChatFalcon.py
Browse files- ChatFalcon.py +3 -4
ChatFalcon.py
CHANGED
|
@@ -23,6 +23,7 @@ from torch import nn
|
|
| 23 |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, LayerNorm, MSELoss
|
| 24 |
from torch.nn import functional as F
|
| 25 |
from transformers import AutoModel,AutoModelForCausalLM, AutoConfig
|
|
|
|
| 26 |
from transformers.modeling_outputs import (
|
| 27 |
BaseModelOutputWithPastAndCrossAttentions,
|
| 28 |
CausalLMOutputWithCrossAttentions,
|
|
@@ -33,7 +34,7 @@ from transformers.modeling_outputs import (
|
|
| 33 |
from transformers.modeling_utils import PreTrainedModel
|
| 34 |
from transformers.utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
|
| 35 |
from .configuration_falcon import FalconConfig
|
| 36 |
-
|
| 37 |
|
| 38 |
logger = logging.get_logger(__name__)
|
| 39 |
|
|
@@ -1266,6 +1267,4 @@ class FalconForQuestionAnswering(FalconPreTrainedModel):
|
|
| 1266 |
attentions=outputs.attentions,
|
| 1267 |
)
|
| 1268 |
|
| 1269 |
-
|
| 1270 |
-
AutoModel.register(FalconConfig, FalconModel)
|
| 1271 |
-
AutoModelForCausalLM.register(FalconConfig, FalconForCausalLM)
|
|
|
|
| 23 |
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, LayerNorm, MSELoss
|
| 24 |
from torch.nn import functional as F
|
| 25 |
from transformers import AutoModel,AutoModelForCausalLM, AutoConfig
|
| 26 |
+
from transformers.models.auto import modeling_auto
|
| 27 |
from transformers.modeling_outputs import (
|
| 28 |
BaseModelOutputWithPastAndCrossAttentions,
|
| 29 |
CausalLMOutputWithCrossAttentions,
|
|
|
|
| 34 |
from transformers.modeling_utils import PreTrainedModel
|
| 35 |
from transformers.utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
|
| 36 |
from .configuration_falcon import FalconConfig
|
| 37 |
+
|
| 38 |
|
| 39 |
logger = logging.get_logger(__name__)
|
| 40 |
|
|
|
|
| 1267 |
attentions=outputs.attentions,
|
| 1268 |
)
|
| 1269 |
|
| 1270 |
+
|
|
|
|
|
|