Views
No views yet

codellama/CodeLlama-34b-hf model fine-tuned using QLoRA (4-bit precision) on 13B tokens of csharp evolved Q&A1base_model: codellama/CodeLlama-34b-hf
2base_model_config: codellama/CodeLlama-34b-hf
3model_type: LlamaForCausalLM
4tokenizer_type: CodeLlamaTokenizer
5is_llama_derived_model: true
6hub_model_id: "Safurai/Evol-csharp-v1"
7
8load_in_8bit: false
9load_in_4bit: true
10strict: false
11
12datasets:
13 - path: Safurai/EvolInstruct-csharp-16k-13B-Alpaca
14 type: alpaca
15dataset_prepared_path: last_run_prepared
16val_set_size: 0.01
17output_dir: ./qlora-out
18
19sequence_len: 4096
20sample_packing: true
21pad_to_sequence_len: true
22
23adapter: lora
24lora_model_dir:
25lora_r: 32
26lora_alpha: 16
27lora_dropout: 0.05
28lora_target_linear: true
29lora_fan_in_fan_out:
30
31wandb_project: codellama-csharp
32wandb_entity:
33wandb_watch:
34wandb_run_id:
35wandb_log_model:
36
37gradient_accumulation_steps: 4
38micro_batch_size: 2
39num_epochs: 3
40optimizer: adamw_bnb_8bit
41lr_scheduler: cosine
42learning_rate: 0.0003
43
44train_on_inputs: false
45group_by_length: false
46bf16: true
47fp16: false
48tf32: false
49
50gradient_checkpointing: true
51early_stopping_patience:
52resume_from_checkpoint:
53local_rank:
54logging_steps: 1
55xformers_attention:
56flash_attention: true
57
58warmup_steps: 40
59eval_steps: 40
60save_steps:
61debug:
62deepspeed:
63weight_decay: 0.0
64fsdp:
65fsdp_config:
66special_tokens:
67 bos_token: "<s>"
68 eos_token: "</s>"
69 unk_token: "<unk>"

1# pip install transformers accelerate
2
3from transformers import AutoTokenizer
4import transformers
5import torch
6
7model = "Safurai/Evol-csharp-full"
8prompt = "User: \n {your question} \n Assistant: "
9
10tokenizer = AutoTokenizer.from_pretrained(model)
11pipeline = transformers.pipeline(
12 "text-generation",
13 model=model,
14 torch_dtype=torch.float16,
15 device_map="auto",
16)
17
18sequences = pipeline(
19 f'{prompt}',
20 do_sample=True,
21 top_k=10,
22 num_return_sequences=1,
23 eos_token_id=tokenizer.eos_token_id,
24 max_length=1024,
25)
26for seq in sequences:
27 print(f"Result: {seq['generated_text']}")