dnagpt / llama-dna-sft

huggingface.co
Total runs: 23
24-hour runs: 5
7-day runs: 8
30-day runs: 14
Model's Last Updated: November 30 2024

Introduction of llama-dna-sft

Model Details of llama-dna-sft

from transformers import AutoTokenizer, AutoConfig,AutoModel
from transformers import DataCollatorForLanguageModeling
from transformers import Trainer, TrainingArguments
from transformers import  AutoConfig, AutoModelForCausalLM,LlamaForCausalLM,LlamaTokenizer
from tokenizers import Tokenizer
from datasets import load_dataset

dna_ft_dataset = load_dataset('dnagpt/dna_multi_task_finetune')

data = dna_ft_dataset["train"].train_test_split(train_size=0.1, seed=42)

tokenizer = LlamaTokenizer.from_pretrained("dnagpt/llama-dna-sft") 
tokenizer.pad_token = tokenizer.eos_token

model = LlamaForCausalLM.from_pretrained("dnagpt/llama-dna-sft") #sft

#构建提示词
def format_input(entry):
    instruction_text = (
        f"Below is an instruction that describes a task. "
        f"Write a response that appropriately completes the request."
        f"\n\n### Instruction:\n{entry['instruction']}"
    )

    input_text = f"\n\n### Input:\n{entry['input']}" if entry["input"] else ""

    return instruction_text + input_text + "\n\n### Response:\n"

#构建提示词
def build_prompt(entry):

    input_data = format_input(entry)

    desired_response = entry['output']

    return input_data + desired_response

example = data["test"][0]

prompt = build_prompt(example)

def inference(text, model, tokenizer, max_input_tokens=1000, max_output_tokens=1000):
  # Tokenize
  input_ids = tokenizer.encode(
          text,
          return_tensors="pt",
          truncation=True,
          max_length=max_input_tokens
          # return_attention_mask=True,
  )

  # Generate
  device = model.device
  generated_tokens_with_prompt = model.generate(
    input_ids=input_ids.to(device),
    #max_length=max_output_tokens,
    max_new_tokens=8,
    temperature=0.01  # 控制生成的多样性
  )

  # Decode
  generated_text_with_prompt = tokenizer.decode(generated_tokens_with_prompt[0], skip_special_tokens=True)
  generated_text_answer = generated_text_with_prompt[len(text):]


  return generated_text_answer


input_text = format_input(data["test"][0])

print("input (test):", input_text)

print("real answer:", data["test"][0]["output"])

print("--------------------------\n")

print("model's answer: \n")
print(inference(input_text, model, tokenizer))





Runs of dnagpt llama-dna-sft on huggingface.co

23
Total runs
5
24-hour runs
7
3-day runs
8
7-day runs
14
30-day runs

More Information About llama-dna-sft huggingface.co Model

More llama-dna-sft license Visit here:

https://choosealicense.com/licenses/mit

llama-dna-sft huggingface.co

llama-dna-sft huggingface.co is an AI model on huggingface.co that provides llama-dna-sft's model effect (), which can be used instantly with this dnagpt llama-dna-sft model. huggingface.co supports a free trial of the llama-dna-sft model, and also provides paid use of the llama-dna-sft. Support call llama-dna-sft model through api, including Node.js, Python, http.

llama-dna-sft huggingface.co Url

https://huggingface.co/dnagpt/llama-dna-sft

dnagpt llama-dna-sft online free

llama-dna-sft huggingface.co is an online trial and call api platform, which integrates llama-dna-sft's modeling effects, including api services, and provides a free online trial of llama-dna-sft, you can try llama-dna-sft online for free by clicking the link below.

dnagpt llama-dna-sft online free url in huggingface.co:

https://huggingface.co/dnagpt/llama-dna-sft

llama-dna-sft install

llama-dna-sft is an open source model from GitHub that offers a free installation service, and any user can find llama-dna-sft on GitHub to install. At the same time, huggingface.co provides the effect of llama-dna-sft install, users can directly use llama-dna-sft installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

llama-dna-sft install url in huggingface.co:

https://huggingface.co/dnagpt/llama-dna-sft

Url of llama-dna-sft

llama-dna-sft huggingface.co Url

Provider of llama-dna-sft huggingface.co

dnagpt
ORGANIZATIONS

Other API from dnagpt

huggingface.co

Total runs: 100
Run Growth: 55
Growth Rate: 55.00%
Updated:August 06 2023
huggingface.co

Total runs: 52
Run Growth: 29
Growth Rate: 55.77%
Updated:December 30 2024
huggingface.co

Total runs: 41
Run Growth: 15
Growth Rate: 36.59%
Updated:October 31 2024
huggingface.co

Total runs: 40
Run Growth: 20
Growth Rate: 50.00%
Updated:October 19 2024
huggingface.co

Total runs: 37
Run Growth: 3
Growth Rate: 8.11%
Updated:February 18 2025
huggingface.co

Total runs: 36
Run Growth: 24
Growth Rate: 66.67%
Updated:January 03 2025
huggingface.co

Total runs: 36
Run Growth: 24
Growth Rate: 66.67%
Updated:November 30 2024
huggingface.co

Total runs: 35
Run Growth: 24
Growth Rate: 68.57%
Updated:February 11 2025
huggingface.co

Total runs: 33
Run Growth: 22
Growth Rate: 66.67%
Updated:September 19 2025
huggingface.co

Total runs: 31
Run Growth: 19
Growth Rate: 61.29%
Updated:January 03 2025
huggingface.co

Total runs: 27
Run Growth: 27
Growth Rate: 100.00%
Updated:October 03 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 20 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 04 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:September 05 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:October 12 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:January 24 2025
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:March 03 2025