Instructions to use SkyworkAIGC/SkyTextTiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SkyworkAIGC/SkyTextTiny with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SkyworkAIGC/SkyTextTiny")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SkyworkAIGC/SkyTextTiny") model = AutoModelForCausalLM.from_pretrained("SkyworkAIGC/SkyTextTiny", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SkyworkAIGC/SkyTextTiny with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SkyworkAIGC/SkyTextTiny" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SkyworkAIGC/SkyTextTiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SkyworkAIGC/SkyTextTiny
- SGLang
How to use SkyworkAIGC/SkyTextTiny 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 "SkyworkAIGC/SkyTextTiny" \ --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": "SkyworkAIGC/SkyTextTiny", "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 "SkyworkAIGC/SkyTextTiny" \ --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": "SkyworkAIGC/SkyTextTiny", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SkyworkAIGC/SkyTextTiny with Docker Model Runner:
docker model run hf.co/SkyworkAIGC/SkyTextTiny
SkyWork commited on
Commit ·
326f068
1
Parent(s): ad7d40d
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SkyTextJunior
|
| 2 |
+
|
| 3 |
+
SkyTextJunior是由奇点智源发布的中文GPT3预训练模型,参数量30亿左右,可以进行聊天、问答、中英互译等不同的[任务](https://openapi.singularity-ai.com/index.html#/examplesIndex)。
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
## 项目亮点
|
| 7 |
+
|
| 8 |
+
1. 技术优势一 :30多道流程的数据清洗
|
| 9 |
+
|
| 10 |
+
随着NLP技术的发展,预训练大模型逐渐成为了人工智能的核心技术之一。预训练大模型通常需要海量的文本来进行训练,网络文本自然成为了最重要的语料来源。而训练语料的质量无疑直接影响着模型的效果。为了训练出能力出众的模型,奇点智源在数据清洗时使用了30多道的清洗流程。精益求精的细节处理,铸造了卓越的模型效果。
|
| 11 |
+
|
| 12 |
+
2. 技术优势二:针对中文优化创新的中文编码方式
|
| 13 |
+
|
| 14 |
+
曾经在预训练大模型领域,一直是被英文社区主导着,而中文预训练大模型的重要性不言而喻。不同于英文的拼音文字,中文预训练大模型的中文输入方式显然应该有所不同。奇点智源针对中文的特点,优化创新使用了独特的中文编码方式,更加符合中文的语言习惯,重新构建出更利于模型理解的中文字典。
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
# 奇点新闻
|
| 19 |
+
|
| 20 |
+
- [2022.12.15] [昆仑天工AIGC发布会](https://live.vhall.com/v3/lives/subscribe/697547540)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
## 依赖
|
| 25 |
+
|
| 26 |
+
```
|
| 27 |
+
推荐
|
| 28 |
+
transformers>=4.16.0
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
## 模型使用
|
| 32 |
+
|
| 33 |
+
```python
|
| 34 |
+
# -*- coding: utf-8 -*-
|
| 35 |
+
from transformers import GPT2LMHeadModel
|
| 36 |
+
from transformers import AutoTokenizer
|
| 37 |
+
from transformers import TextGenerationPipeline
|
| 38 |
+
|
| 39 |
+
model = GPT2LMHeadModel.from_pretrained("SkyWork/SkyTextJunior")
|
| 40 |
+
tokenizer = AutoTokenizer.from_pretrained("SkyWork/SkyTextJunior", trust_remote_code=True)
|
| 41 |
+
text_generator = TextGenerationPipeline(model, tokenizer, device=0)
|
| 42 |
+
input_str = "今天是个好天气"
|
| 43 |
+
max_new_tokens = 20
|
| 44 |
+
print(text_generator(input_str, max_new_tokens=max_new_tokens, do_sample=True))
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
# 版权许可
|
| 48 |
+
|
| 49 |
+
[MIT License]
|