Phi-Hermes-1.3B

我要开发同款
匿名用户2024年07月31日
29阅读
所属分类ai、mixformer-sequential、Pytorch、microsoft、phi
开源地址https://modelscope.cn/models/keepitsimple/Phi-Hermes-1.3B
授权协议other

作品详情

Phi-1.5 fine tuned with Hermes Dataset

Model Details

Model Sources

This model was trained on the OpenHermes Dataset, made by me, which is over 240,000 mostly GPT-4 generated synthetic datapoints

image/png

image/png

Uses

Let me know!

How to Get Started with the Model

Phi does not support device_map "auto", and does not seem to want to inference in fp16, so use bf16.

Here is working code to inference, though it can be improved:

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("teknium/Puffin-Phi-v2", trust_remote_code=True, torch_dtype=torch.bfloat16).to("cuda")
tokenizer = AutoTokenizer.from_pretrained("teknium/Puffin-Phi-v2", trust_remote_code=True, torch_dtype=torch.bfloat16)
inputs = tokenizer(f"### Instruction:\nWrite a negative review for the website, Twitter.\n### Response:\n", return_tensors="pt", return_attention_mask=False)
outputs = model.generate(**inputs, max_length=128, do_sample=True, temperature=0.2, top_p=0.9, use_cache=True, repetition_penalty=1.2, eos_token_id=tokenizer.eos_token_id)
text = tokenizer.batch_decode(outputs)[0]
print(text)

The prompt format is Alpaca, then is prompted like so:

### Instruction:
<prompt>
### Response:

Training Details

Training Procedure

Trained with Axolotl. View the wandb runs for all my puffin runs (this is puffin-phi-4 on wandb): https://wandb.ai/teknium1/hermes-phi/runs/hermes-phi-1

Evaluation

image/png

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论