Dedicated Endpoints

Run this model inference on single tenant GPU with unmatched speed and reliability at scale.

Learn more
Container

Run this model inference with full control and performance in your environment.

Learn more

Get help setting up a custom Dedicated Endpoints.

Talk with our engineer to get a quote for reserved GPU instances with discounts.

README

License: apache-2.0

訓練配置

項目
架構GPT-2 (12 layers, 12 heads, 768 hidden)
參數量124,242,432 (~124M)
Context length128 tokens
Tokenizerhuggingface-course/code-search-net-tokenizer (BPE, vocab=50,000)
訓練資料huggingface-course/codeparrot-ds-train (1 epoch, 16.7M chunks)
驗證資料huggingface-course/codeparrot-ds-valid
OptimizerAdamW
Learning rate5e-4, cosine warmup 1000 steps
Weight decay0.1
Effective batch size256 (per_device_bs=64 × grad_accum=2 × world_size=2)
Mixed precisionfp16
訓練步數65,243 (1 epoch)
訓練時間~19 小時
硬體2 × AMD Radeon Instinct MI50 (gfx906) via PyTorch ROCm + DDP

訓練結果

stepepochtrain_losseval_loss
5,0000.0772.6771.752
10,0000.1531.6851.520
15,0000.2301.5291.415
20,0000.3071.4471.347
25,0000.3831.3861.295
30,0000.4601.3341.247
35,0000.5371.2881.204
60,0000.9201.054
65,2431.0001.1061.051

使用方法

python

from transformers import pipeline
pipe = pipeline("text-generation", model="Marcoson320/codeparrot-ds-from-scratch", device=0)
prompt = """\
# create some data
x = np.random.randn(100)
y = np.random.randn(100)
# create scatter plot with x, y
"""
print(pipe(prompt, max_new_tokens=64, num_return_sequences=1)[0]["generated_text"])

範例輸出:

python

# create scatter plot with x, y
axScatter = fig.add_subplot(111)
axScatter.scatter(x, y, s=50, marker="d", c="red", alpha=0.7)

已知限制

  • 小模型 + ctx=128:容易在 continuation 中陷入 repetition loop,可在推論時加 repetition_penalty=1.2no_repeat_ngram_size=3 緩解。
  • API coverage 有限:訓練資料雖然覆蓋 pandas/sklearn/matplotlib/seaborn,但較少見的 API call 可能寫不出來。
  • 無 instruction tuning:純 continuation model,不能對話。

致謝

License

Apache-2.0

Model provider

Marcoson320

Model tree

Base

this model

Modalities

Input

Text

Output

Text

Pricing

Dedicated Endpoints

View details

Supported Functionality

Model APIs

Dedicated Endpoints

Container

More information

Explore FriendliAI today