Instructions to use goldfish-models/kon_latn_full with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use goldfish-models/kon_latn_full with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="goldfish-models/kon_latn_full")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("goldfish-models/kon_latn_full") model = AutoModelForCausalLM.from_pretrained("goldfish-models/kon_latn_full") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use goldfish-models/kon_latn_full with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "goldfish-models/kon_latn_full" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "goldfish-models/kon_latn_full", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/goldfish-models/kon_latn_full
- SGLang
How to use goldfish-models/kon_latn_full 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 "goldfish-models/kon_latn_full" \ --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": "goldfish-models/kon_latn_full", "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 "goldfish-models/kon_latn_full" \ --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": "goldfish-models/kon_latn_full", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use goldfish-models/kon_latn_full with Docker Model Runner:
docker model run hf.co/goldfish-models/kon_latn_full
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -12,7 +12,7 @@ library_name: transformers
|
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
tags:
|
| 14 |
- goldfish
|
| 15 |
-
|
| 16 |
---
|
| 17 |
|
| 18 |
# kon_latn_full
|
|
@@ -23,7 +23,7 @@ The Goldfish models are trained primarily for comparability across languages and
|
|
| 23 |
|
| 24 |
Note: kon_latn is a [macrolanguage](https://iso639-3.sil.org/code_tables/639/data) code. None of its contained individual languages are included in Goldfish (for script latn).
|
| 25 |
|
| 26 |
-
All training and hyperparameter details are in our paper, [Goldfish: Monolingual Language Models for 350 Languages (Chang et al., 2024)](https://
|
| 27 |
|
| 28 |
Training code and sample usage: https://github.com/tylerachang/goldfish
|
| 29 |
|
|
@@ -33,6 +33,7 @@ Sample usage also in this Google Colab: [link](https://colab.research.google.com
|
|
| 33 |
|
| 34 |
To access all Goldfish model details programmatically, see https://github.com/tylerachang/goldfish/blob/main/model_details.json.
|
| 35 |
All models are trained with a [CLS] (same as [BOS]) token prepended, and a [SEP] (same as [EOS]) token separating sequences.
|
|
|
|
| 36 |
Details for this model specifically:
|
| 37 |
|
| 38 |
* Architecture: gpt2
|
|
@@ -61,5 +62,6 @@ If you use this model, please cite:
|
|
| 61 |
author={Chang, Tyler A. and Arnett, Catherine and Tu, Zhuowen and Bergen, Benjamin K.},
|
| 62 |
journal={Preprint},
|
| 63 |
year={2024},
|
|
|
|
| 64 |
}
|
| 65 |
```
|
|
|
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
tags:
|
| 14 |
- goldfish
|
| 15 |
+
- arxiv:2408.10441
|
| 16 |
---
|
| 17 |
|
| 18 |
# kon_latn_full
|
|
|
|
| 23 |
|
| 24 |
Note: kon_latn is a [macrolanguage](https://iso639-3.sil.org/code_tables/639/data) code. None of its contained individual languages are included in Goldfish (for script latn).
|
| 25 |
|
| 26 |
+
All training and hyperparameter details are in our paper, [Goldfish: Monolingual Language Models for 350 Languages (Chang et al., 2024)](https://www.arxiv.org/abs/2408.10441).
|
| 27 |
|
| 28 |
Training code and sample usage: https://github.com/tylerachang/goldfish
|
| 29 |
|
|
|
|
| 33 |
|
| 34 |
To access all Goldfish model details programmatically, see https://github.com/tylerachang/goldfish/blob/main/model_details.json.
|
| 35 |
All models are trained with a [CLS] (same as [BOS]) token prepended, and a [SEP] (same as [EOS]) token separating sequences.
|
| 36 |
+
For best results, make sure that [CLS] is prepended to your input sequence (see sample usage linked above)!
|
| 37 |
Details for this model specifically:
|
| 38 |
|
| 39 |
* Architecture: gpt2
|
|
|
|
| 62 |
author={Chang, Tyler A. and Arnett, Catherine and Tu, Zhuowen and Bergen, Benjamin K.},
|
| 63 |
journal={Preprint},
|
| 64 |
year={2024},
|
| 65 |
+
url={https://www.arxiv.org/abs/2408.10441},
|
| 66 |
}
|
| 67 |
```
|